> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Run your Mini App locally inside the Startale Mini App sandbox.

The [`miniapp-sandbox`](https://github.com/StartaleGroup/miniapp-sandbox) is a local approximation of the Startale App host. It loads your Mini App in an iframe with the right sandbox attributes, simulates `sdk.context`, and exercises the full Mini App handshake.

## Run it

<Tip>
  No local setup needed: preview your Mini App directly at [app.startale.com/developers/preview](https://app.startale.com/developers/preview).
</Tip>

For a fully local environment:

```bash theme={null}
git clone https://github.com/StartaleGroup/miniapp-sandbox.git
cd miniapp-sandbox
pnpm install
pnpm dev
```

Sandbox runs at [localhost:3100](http://localhost:3100).

## Register your Mini App

Edit `src/pages/configMiniApps.ts`:

```ts theme={null}
export const MINI_APPS: MiniAppConfig[] = [
  { url: 'http://localhost:5173/' },
]
```

The sandbox auto-fetches your Mini App's `/.well-known/farcaster.json` to populate the launcher card.

## What the sandbox simulates

| Feature                           | Sandbox                                | Production Startale App                      |
| --------------------------------- | -------------------------------------- | -------------------------------------------- |
| `sdk.context.startale.starPoints` | Hardcoded `100`                        | Real STAR Points balance                     |
| `sdk.context.startale.eoaWallets` | Not provided                           | Provided as `string[]` of verified addresses |
| Wallet connection                 | Wagmi + Startale connector             | Smart account via host                       |
| EIP-1193 signing                  | Routes through your local wagmi client | Routes through the user's smart account      |

## Known gaps

* `eoaWallets` is not simulated. Test EOA-discovery flows against staging or production.
* Notifications via `addMiniApp` work locally only if you have configured a webhook endpoint reachable from the sandbox.
* `sendToken` and `swapToken` actions return `not_supported` in the sandbox.

## Iframe sandbox attributes

The sandbox loads your Mini App with:

```
sandbox="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin"
allow="clipboard-read; clipboard-write"
```

Your Mini App must function with these attributes. For example, popups opened from inside the iframe escape the sandbox, which is required for the Startale wallet popup.
