# Build a mobile neobank

Use Openfort's React Native SDK to create a mobile neobank. Embedded wallets and sponsored gas policies allow users to manage stablecoins without seed phrases or gas fees.

## Prerequisites

* [Node.js](https://nodejs.org/) (v18+)
* An [Expo](https://expo.dev/) development environment
* An [Openfort](https://dashboard.openfort.io/) account with a project created

## Install the Openfort CLI

```bash
npm install -g @openfort/cli
openfort login
```

## Teach your agent to use Openfort

Register the CLI as an MCP server so your agent can call Openfort tools directly:

```bash
openfort mcp add
```

Or, if your agent supports skills:

:::code-group

```bash [Claude Code]
claude -p "Read https://github.com/openfort-xyz/agent-skills and set up Openfort CLI"
```

```bash [Amp]
amp --execute "Read https://github.com/openfort-xyz/agent-skills and set up Openfort CLI"
```

```bash [Codex CLI]
codex exec "Read https://github.com/openfort-xyz/agent-skills and set up Openfort CLI"
```

:::

## Walkthrough

::::steps

### 1. Set up embedded wallet keys

Generate the Shield API keys required for embedded wallets:

> **Prompt your agent**: "Run `embedded-wallet setup` to generate and register the Shield API keys for this project."

This produces your `OPENFORT_SHIELD_PUBLISHABLE_KEY`. Save it — you'll need it for the provider configuration.

### 2. Create the React Native project

Scaffold the app and install all required dependencies:

> **Prompt your agent**: "Create a new Expo React Native app. Install `@openfort/react-native` and its required peer dependencies: `expo-secure-store`, `expo-crypto`, `expo-web-browser`, `expo-linking`, `expo-application`, `expo-apple-authentication`, and `react-native-webview`. Also install `@solana/kit`, `@solana/kora`, and `@solana/transaction-confirmation` for Solana transaction support."

:::info
`react-native-passkeys` is already bundled with `@openfort/react-native` — do not install it separately to avoid version conflicts.
:::

### 3. Configure the OpenfortProvider

Set up the provider with passkey recovery at the root of your app:

> **Prompt your agent**: "Wrap the app in an `OpenfortProvider` from `@openfort/react-native`. Configure it with passkey recovery using these settings:"

```tsx
import { OpenfortProvider, RecoveryMethod } from '@openfort/react-native';

<OpenfortProvider
  publishableKey={process.env.OPENFORT_PUBLISHABLE_KEY}
  walletConfig={{
    recoveryMethod: RecoveryMethod.PASSKEY,
    shieldPublishableKey: process.env.OPENFORT_SHIELD_PUBLISHABLE_KEY,
    passkeyRpId: 'yourdomain.com',
    passkeyRpName: 'Your App',
    passkeyDisplayName: 'Your App Wallet',
  }}
>
  {/* App content */}
</OpenfortProvider>
```

| Environment variable | Description |
|---|---|
| `OPENFORT_PUBLISHABLE_KEY` | Your Openfort publishable key (from dashboard) |
| `OPENFORT_SHIELD_PUBLISHABLE_KEY` | Generated in Step 1 |
| `PASSKEY_RP_ID` | Your domain (e.g., `yourdomain.com`) |

### 4. Set up domain verification

Passkeys require platform-specific domain binding. Without this, passkey creation will fail on devices.

> **Prompt your agent**: "Set up passkey domain verification. For iOS, create an `apple-app-site-association` file with `webcredentials` for our team ID and bundle ID, served at `https://yourdomain.com/.well-known/apple-app-site-association`. For Android, create an `assetlinks.json` with our package name and SHA256 fingerprint at `https://yourdomain.com/.well-known/assetlinks.json`."

### 5. Create wallets on signup

Use the `useEmbeddedSolanaWallet` hook to provision a wallet when a user registers:

> **Prompt your agent**: "Create a signup screen that uses the `useEmbeddedSolanaWallet` hook from `@openfort/react-native`. After authentication, call `create({ recoveryMethod: 'passkey' })` to provision a Solana embedded wallet. Display the wallet address on success."

```tsx
import { useEmbeddedSolanaWallet } from '@openfort/react-native';

const { create, status, activeWallet } = useEmbeddedSolanaWallet();

await create({
  recoveryMethod: 'passkey',
  onSuccess: ({ account }) => {
    console.log('Wallet created:', account.address);
  },
});
```

### 6. Create a gas sponsorship policy

Set up a policy so users don't pay transaction fees. Use the Openfort CLI:

> **Prompt your agent**: "Create a project-scoped policy using `policies create` that accepts `sponsorSolTransaction` operations. Then create a fee sponsorship linked to that policy using `sponsorship create`."

This ensures the Kora paymaster will sponsor your users' Solana transactions.

### 7. Transfer stablecoins

Build the transfer screen using the embedded wallet provider and Kora for gas sponsorship:

> **Prompt your agent**: "Create a transfer screen that accepts a Solana address and USDC amount. Use the `provider` from `useEmbeddedSolanaWallet` for signing. Construct a sponsored transaction using `@solana/kit` and `@solana/kora`:
>
> 1. Create a `KoraClient` pointing to `https://api.openfort.io/rpc/solana/devnet` with the publishable key as the Bearer token
> 2. Get the fee payer signer via `getPayerSigner()`
> 3. Build a transfer instruction for the USDC token
> 4. Sign the transaction with the user's embedded wallet provider
> 5. Call `signAndSendTransaction()` on the KoraClient to co-sign and broadcast"

::::

## Next steps

* [React Native quickstart](/docs/products/embedded-wallet/react-native)
* [Passkey recovery setup](/docs/products/embedded-wallet/react-native/quickstart/passkey)
* [Solana paymaster](/docs/products/infrastructure/paymaster/solana)
* [useEmbeddedSolanaWallet hook](/docs/products/embedded-wallet/react-native/hooks/useEmbeddedSolanaWallet)
