Skip to main content

Overview

The Embedded Wallet Kit provides a straightforward way to create and manage embedded wallets in your React Native application. EWK offers function abstractions to easily create embedded wallets, derive accounts, import and export wallets and more. Before we start, ensure you’re familiar with the concepts of Wallets and Wallet Accounts.

Creating an embedded wallet

After your user has authenticated, you can create an embedded wallet using the createWallet function from the useTurnkey hook. This will create a new wallet within the end-user’s sub-organization with one Ethereum and one Solana wallet account.
This wallet can then be accessed through the wallets array in the useTurnkey hook, which contains all embedded wallets associated with the sub-organization and all linked external wallets. This array is updated automatically when wallets are created, updated or removed.
You can also manually refresh the wallets by calling the refreshWallets function from the useTurnkey hook.

Creating wallet accounts

You can specify which accounts to create in the wallet by passing an array of account formats or account objects to the accounts parameter.

Using address formats

You can use predefined account formats to create accounts in the wallet. The wallet account will be automatically created with the correct path and path index based on the existing wallet the sub-organization has.

Using account objects

You can also create accounts by passing an array of account objects. This allows you to specify the curve, pathFormat, path, and addressFormat.

After wallet creation

You can use the createWalletAccount function to add more accounts to an existing wallet.

Importing and exporting wallets

React Native Wallet Kit lets you securely import/export wallets, accounts, and private keys using encrypted bundles you control, enabling backup, recovery, and migration.

Export

By default, React Native Wallet Kit exports will decrypt locally and return the secret to you (mnemonic or raw private key) for easier developer workflows. To receive an encrypted ExportBundle instead, pass decrypt: false and provide a targetPublicKey. You can scope exports to a sub-organization via organizationId (otherwise the current session’s organization is used) and choose an authentication stamper via stampWith (Passkey, ApiKey).

Wallets

Export the specified wallet and its accounts.
  • Default: returns the mnemonic (decrypted locally).
  • Advanced: set decrypt: false to receive an encrypted bundle for storage/transfer.
Advanced (encrypted bundle):

Wallet accounts

Export a single wallet account.
  • Default: returns the raw private key (decrypted locally). Do not display in production UIs.
  • Advanced: set decrypt: false to receive an encrypted bundle.

Private keys

Export a private key.
  • Default: returns the raw private key (decrypted locally). Do not display in production UIs.
  • Advanced: set decrypt: false to receive an encrypted bundle.

Import

Imports take plaintext material (mnemonic/private key) and the provider handles initialization and encryption behind the scenes. Resources are created under the current session’s organization and user by default. You can override both with organizationId and userId, and optionally choose a stamper via stampWith (Passkey, ApiKey).

Wallets

Imports a wallet from a mnemonic. Optionally pre-create accounts; defaults may apply if not provided.

Private keys

Imports a private key from plaintext key material. You can optionally provide one or more address formats; the cryptographic curve is inferred from the address format and can be overridden via curve.

Next steps

Check out the Signing guide to learn how to sign transactions and messages with the embedded wallets you’ve created.