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

# Dynamic

> Pair Dynamic's embedded wallet kit with Altude Gas Station to deliver gasless Solana transactions.

[Dynamic](https://dynamic.xyz) provides embedded wallets with a rich authentication kit — email login, social providers, and external wallet connections. Users sign in and get a Solana wallet provisioned automatically. Gas Station handles fee sponsorship and relay: once Dynamic's embedded wallet has signed the transaction, Gas Station submits it to Solana and covers the fee.

***

## How the integration works

Dynamic and Gas Station operate on separate layers:

| What Dynamic handles                                  | What Gas Station handles                 |
| ----------------------------------------------------- | ---------------------------------------- |
| User authentication (email, social, external wallets) | Fetching the sponsored fee payer address |
| Embedded wallet provisioning                          | Validating the signed transaction        |
| Prompting the user to sign a transaction              | Relaying the transaction to Solana       |
| Returning the signed transaction to your app          | Sponsoring the Solana transaction fee    |

Your app builds a transaction using the fee payer returned by `GET /api/transaction/config`. Dynamic signs it. Gas Station relays it. The user never pays gas.

```mermaid theme={null}
%%{init: {'theme': 'base', 'themeVariables': {'fontFamily': 'Inter, ui-sans-serif, sans-serif', 'fontSize': '13px', 'primaryColor': '#0d2233', 'primaryTextColor': '#e2e8f0', 'primaryBorderColor': '#3DBFF2', 'lineColor': '#3DBFF2', 'edgeLabelBackground': 'transparent', 'clusterBkg': 'transparent'}}}%%
flowchart LR
    A([Your App]) -->|sign| B([Gas Station API])
    B -->|relay + fee| C([Solana Network])

    style A fill:#0d2233,color:#e2e8f0,stroke:#3DBFF2,stroke-width:1.5px
    style B fill:#3DBFF2,color:#071922,stroke:#049DD9,stroke-width:1.5px
    style C fill:#049DD9,color:#ffffff,stroke:#037dac,stroke-width:1.5px
    linkStyle default stroke:#3DBFF2,stroke-width:1.5px,fill:none
```

Dynamic loads as an iframe inside your app and handles authentication and signing in that context. From the relay perspective, your app is the origin.

***

## Demo

The Dynamic demo is a working React application that walks through the full gasless transaction flow:

<Card title="altude-dynamic-gas-station-demo" icon="github" href="https://github.com/AltudePlatform/altude-dynamic-gas-station-demo">
  Clone the demo to run a complete Dynamic + Gas Station integration on Solana devnet.
</Card>

The demo covers:

* **Authentication** — Dynamic handles email sign-in and provisions an embedded Solana wallet
* **Transaction building** — `SystemProgram.createAccount` with Altude as fee payer
* **Gasless relay** — Signed transactions submitted through `POST /api/Account/create` and `POST /api/Transaction/send`
* **Transaction history** — Persistent history with Solscan explorer links
* **Mock fallback** — Runs without an Altude API key, simulating the full flow

### The four-step flow

The demo walks through a step-by-step flow that shows where Dynamic ends and Gas Station begins:

| Step                      | What happens                                                                      | Who handles it                |
| ------------------------- | --------------------------------------------------------------------------------- | ----------------------------- |
| **1. Create transaction** | A `SystemProgram.createAccount` transaction is built with Altude as the fee payer | Your app + Gas Station config |
| **2. Sign with wallet**   | Dynamic prompts the embedded wallet to sign                                       | Dynamic                       |
| **3. Register account**   | The signed transaction is sent to `POST /api/Account/create`                      | **Gas Station**               |
| **4. Send transaction**   | The signed transaction is relayed through `POST /api/Transaction/send`            | **Gas Station**               |

***

## Quick setup

### 1. Get your credentials

You need two things before running the demo:

* **Dynamic Environment ID** — from [app.dynamic.xyz](https://app.dynamic.xyz). Create a project, then go to **Developer → SDK & API Keys** and copy your Environment ID. Make sure Solana is enabled under **Chains and Networks**.
* **Altude API key** — from [app.altude.so](https://app.altude.so). Create an application and copy the devnet key.

### 2. Clone and configure

```bash theme={null}
git clone https://github.com/AltudePlatform/altude-dynamic-gas-station-demo.git
cd altude-dynamic-gas-station-demo
npm install
cp .env.example .env
```

Open `.env` and set your credentials:

```bash theme={null}
# Dynamic — https://app.dynamic.xyz (required)
VITE_DYNAMIC_ENVIRONMENT_ID=your-environment-id-here

# Altude — https://app.altude.so
VITE_ALTUDE_API_KEY_DEVNET=your-devnet-api-key-here
VITE_ALTUDE_API_KEY_MAINNET=your-mainnet-api-key-here  # optional
```

<Note>
  The Dynamic Environment ID is required — the app will not load without it. The Altude API keys are optional per-network; any network without a key runs in mock mode, simulating the full flow without on-chain transactions.
</Note>

### 3. Run

```bash theme={null}
npm run dev
```

Open [http://localhost:5000](http://localhost:5000). Sign in with email, walk through the four-step transaction flow, and watch Gas Station relay the transaction without the user paying gas.

***

## Adapter pattern

The Dynamic adapter lives in `src/wallet/dynamic.tsx` and exports three symbols: `WalletProvider`, `useWallet`, and `WalletButton`. The rest of the app uses these through a single re-export in `src/wallet/index.ts` — switching providers means changing one line. To see how the adapter interface works or to adapt this for a different provider, see the [integration overview](/integrations/overview#integration-patterns).

***

## Related

<CardGroup cols={2}>
  <Card title="Integration overview" icon="book" href="/integrations/overview">
    Architecture, custody model, and how Gas Station fits alongside any wallet provider.
  </Card>

  <Card title="Gas Station API reference" icon="code" href="/api-reference/introduction">
    Full reference for `/api/Account/create`, `/api/Transaction/send`, and other endpoints.
  </Card>
</CardGroup>
