> For the complete documentation index, see [llms.txt](https://docs.megaeth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.megaeth.com/moss-docs/core-sdk/installation.md).

# Installation

The core package is `@megaeth-labs/wallet-sdk`. Use it when you want direct access to the `mega` object without the React provider and hooks layer. The React SDK wraps this same package.

Published at: [npmjs.com/package/@megaeth-labs/wallet-sdk](https://www.npmjs.com/package/@megaeth-labs/wallet-sdk).

## Install

```bash
# pick your package manager
npm install @megaeth-labs/wallet-sdk
pnpm add @megaeth-labs/wallet-sdk
yarn add @megaeth-labs/wallet-sdk
```

## Import Surface

```ts
import { mega } from '@megaeth-labs/wallet-sdk';
import type {
  Config,
  ConnectionStatus,
  TransferRequest,
  CallContractRequest,
  GrantPermissionsRequest,
} from '@megaeth-labs/wallet-sdk';
```

## What You Get

* `mega.initialise(config)` — one-time setup, see [`mega.initialise()`](/moss-docs/methods/methods/initialise.md).
* `mega.events.onStatusChange(callback)` — wallet status subscription.
* Wallet actions: `connect`, `disconnect`, `status`, `open`, `transfer`, `send`, `swap`, `signMessage`, `signData`, `authenticate`, `callContract`, `getFromContract`, `deposit`, `balances`.
* Smart Approvals: `grantPermissions`, `getPermissions`, `revokePermissions`.
* Shared request/response types for integration-safe code.

The SDK currently ships as ESM + CJS bundles with type declarations. It uses [Penpal](https://github.com/Aaronius/penpal) to bridge the parent window to the hosted MOSS wallet iframe.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.megaeth.com/moss-docs/core-sdk/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
