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

# Flow: Getting Started

> Set up the Dynamic client for Fireblocks Flow — enable chains, add extensions, and create your first flow.

<Note>
  This is an enterprise-only feature. Please [contact us](https://www.dynamic.xyz/book-a-call) to enable.
</Note>

This guide walks through the one-time setup required before you can run a [Fireblocks Flow](/docs/overview/fireblocks-flow) payment, deposit, or withdrawal using the JavaScript SDK.

## Prerequisites

* A [Dynamic](https://app.dynamic.xyz) environment with Fireblocks Flow enabled
* A Dynamic client created and initialized (see [Creating a Dynamic Client](/docs/javascript/reference/client/create-dynamic-client))

## 1. Enable chains in the dashboard

Open **Chains & Networks** in the [Dynamic dashboard](https://app.dynamic.xyz/dashboard/chains-and-networks) and enable every chain you want users to pay from. Flow supports these source chains:

| Chain                                         | Dashboard toggle | Extension package           |
| :-------------------------------------------- | :--------------- | :-------------------------- |
| EVM (Ethereum, Base, Polygon, Arbitrum, etc.) | **EVM**          | `@dynamic-labs-sdk/evm`     |
| Solana                                        | **Solana**       | `@dynamic-labs-sdk/solana`  |
| Bitcoin                                       | **Bitcoin**      | `@dynamic-labs-sdk/bitcoin` |
| Sui                                           | **Sui**          | `@dynamic-labs-sdk/sui`     |
| TRON                                          | **Tron**         | `@dynamic-labs-sdk/tron`    |

Enable only the chains your users need. Each chain you enable appears in the wallet connection flow.

## 2. Install chain extension packages

Install the packages for the chains you enabled:

```bash theme={"system"}
npm install @dynamic-labs-sdk/evm @dynamic-labs-sdk/solana @dynamic-labs-sdk/bitcoin @dynamic-labs-sdk/sui @dynamic-labs-sdk/tron
```

Remove any packages for chains you did not enable.

## 3. Add chain extensions to the client

After creating your Dynamic client, add an extension for each chain. Extensions register wallet providers so the SDK can discover, connect, and sign with wallets on that chain.

```javascript theme={"system"}
import { createDynamicClient, initializeClient } from "@dynamic-labs-sdk/client";
import { addEvmExtension } from "@dynamic-labs-sdk/evm";
import { addWalletConnectEvmExtension } from "@dynamic-labs-sdk/evm/wallet-connect";
import { addSolanaExtension } from "@dynamic-labs-sdk/solana";
import { addWalletConnectSolanaExtension } from "@dynamic-labs-sdk/solana/wallet-connect";
import { addBitcoinExtension } from "@dynamic-labs-sdk/bitcoin";
import { addSuiExtension } from "@dynamic-labs-sdk/sui";
import { addTronExtension } from "@dynamic-labs-sdk/tron";

createDynamicClient({
  environmentId: "<YOUR_ENVIRONMENT_ID>",
});

// Add one extension per enabled chain
addEvmExtension();
addSolanaExtension();
addBitcoinExtension();
addSuiExtension();
addTronExtension();

// Optional: add WalletConnect so users can connect mobile wallets via QR code
addWalletConnectEvmExtension();
addWalletConnectSolanaExtension();

initializeClient();
```

Only call the extensions for chains you enabled in the dashboard. WalletConnect extensions are optional but recommended — they let users scan a QR code to connect mobile wallets like MetaMask Mobile or Phantom Mobile. See [Adding Extensions](/docs/javascript/reference/adding-extensions) for the full list and standalone extension variants.

## 4. Create an API token

Go to **Developer > API Tokens** in the [dashboard](https://app.dynamic.xyz) and create a token with `flow.write` scope. This token authenticates flow creation from your backend — it is the only call that requires it. Everything after flow creation uses a session token minted by the SDK.

## 5. Create a flow from your backend

Call the flow creation endpoint from your server. This is where you set the mode, amount, currency, settlement, and destination — all fixed at creation time.

```bash theme={"system"}
curl --request POST \
  --url https://app.dynamic.xyz/api/v0/server/<YOUR_ENVIRONMENT_ID>/flow/payment \
  --header 'Authorization: Bearer <YOUR_API_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{
    "amount": "25.00",
    "currency": "USD",
    "settlementConfig": {
      "strategy": "cheapest",
      "settlements": [
        {
          "chainName": "EVM",
          "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "chainId": "1",
          "symbol": "USDC",
          "tokenDecimals": 18
        }
      ]
    },
    "destinationConfig": {
      "destinations": [
        {
          "chainName": "EVM",
          "type": "address",
          "identifier": "0xYourSettlementAddress"
        }
      ]
    },
    "memo": {
      "description": "Payment for order #1234"
    }
  }'
```

The response includes a `flow.id`. Pass this to your frontend as `flowId` when calling the SDK functions.

<Note>
  **Optional — collect your own fee.** Add a `feeConfig` to the create body to take a percentage of each swap to your own EVM wallet(s). Recipient addresses must be EVM (`0x…`). See [Fee collection and claiming](/docs/overview/fireblocks-flow-api#fee-collection-and-claiming) for the config shape, how to check balances, and how to claim accrued fees.
</Note>

## Next steps

With the client configured and a `flowId` from your backend, you're ready to run the flow on the client:

* [Fireblocks Flow JavaScript guide](/docs/overview/fireblocks-flow-js-sdk) — Full walkthrough: attach source, quote, submit, and poll
* [Fireblocks Flow API guide](/docs/overview/fireblocks-flow-api) — Raw HTTP version for backend services and AI agents
* [`attachFlowSource`](/docs/javascript/reference/client/attach-flow-source) — Attach a wallet or exchange as the funding source
* [`getFlowQuote`](/docs/javascript/reference/client/get-flow-quote) — Get a conversion quote
* [`submitFlowTransaction`](/docs/javascript/reference/client/submit-flow-transaction) — Sign and broadcast
