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

# Quickstart

> Get a working Blink deposit integration in 5 minutes.

This guide gets you from zero to a working deposit flow. You will install the SDK, set up a minimal signer endpoint, and trigger your first transfer.

## Integrate with an AI agent

If you want an agent to scaffold this flow for you, use the [AI Agent guide](/ai-agent) or paste this URL directly into Cursor, Claude Code, or your coding agent:

```
https://raw.githubusercontent.com/swype-org/docs/refs/heads/main/prompts/integrate-blink.md
```

## 1. Install the SDK

<CodeGroup>
  ```bash npm theme={null}
  npm install @swype-org/deposit
  ```

  ```bash yarn theme={null}
  yarn add @swype-org/deposit
  ```

  ```bash pnpm theme={null}
  pnpm add @swype-org/deposit
  ```
</CodeGroup>

## 2. Create a signer endpoint

Add a server route that signs payment requests. This minimal Express example covers the essentials:

```javascript theme={null}
const express = require('express');
const { randomUUID, createSign } = require('node:crypto');
const fs = require('node:fs');

const app = express();
app.use(express.json());

const MERCHANT_ID = process.env.MERCHANT_ID;
const PRIVATE_KEY_PEM = process.env.MERCHANT_PRIVATE_KEY
  || fs.readFileSync('./private.pem', 'utf8');

app.post('/api/sign-payment', (req, res) => {
  const { amount, chainId, address, token, callbackScheme = null, version = 'v1' } = req.body;

  const idempotencyKey = randomUUID();
  const signatureTimestamp = new Date().toISOString();

  const payloadObject = {
    amount, chainId, address, token,
    idempotencyKey, callbackScheme, signatureTimestamp, version,
  };

  const payload = Buffer.from(JSON.stringify(payloadObject), 'utf8').toString('base64url');

  const signer = createSign('SHA256');
  signer.update(payload);
  signer.end();
  const signature = signer.sign(PRIVATE_KEY_PEM).toString('base64url');

  res.json({
    merchantId: MERCHANT_ID,
    payload,
    signature,
    preview: { amount, chainId, address, token, idempotencyKey },
  });
});

app.listen(3001);
```

<Tip>
  Set your environment variables:

  ```bash theme={null}
  export MERCHANT_ID="your-merchant-uuid"
  export MERCHANT_PRIVATE_KEY="$(cat private.pem)"
  ```
</Tip>

<Info>
  See [Build Your Signer Endpoint](/integration/signer-endpoint) for the full implementation with validation, security, and a Python equivalent.
</Info>

## 3. Trigger the transfer

<CodeGroup>
  ```typescript JavaScript theme={null}
  import { Deposit, DepositError, getDisplayMessage } from '@swype-org/deposit';

  const deposit = new Deposit({
    signer: '/api/sign-payment',
  });

  document.getElementById('transfer-btn').addEventListener('click', async () => {
    try {
      const { transfer: result } = await deposit.requestDeposit({
        amount: 50,
        chainId: 8453,
        address: '0x1a5FdBc891c5D4E6aD68064Ae45D43146D4F9f3a',
        token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
      });
      console.log('Transfer complete:', result.id, result.status);
    } catch (error) {
      if (error instanceof DepositError) {
        alert(getDisplayMessage(error));
      }
    }
  });
  ```

  ```tsx React theme={null}
  import { useBlinkDeposit } from '@swype-org/deposit/react';

  function DepositButton() {
    const { status, result, error, displayMessage, requestDeposit } = useBlinkDeposit({
      signer: '/api/sign-payment',
    });

    const handleDeposit = () => {
      requestDeposit({
        amount: 50,
        chainId: 8453,
        address: '0x1a5FdBc891c5D4E6aD68064Ae45D43146D4F9f3a',
        token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
      });
    };

    return (
      <>
        <button onClick={handleDeposit} disabled={status === 'signer-loading'}>
          {status === 'signer-loading' ? 'Preparing...' : 'Deposit $50'}
        </button>
        {error && <p className="error">{displayMessage}</p>}
        {result && <p>Transfer {result.transfer.id} complete!</p>}
      </>
    );
  }
  ```
</CodeGroup>

## What's next

You now have a working deposit flow. To go to production:

<Steps>
  <Step title="Generate a production key pair">
    [Key Generation](/integration/key-generation). Create ECDSA P-256 keys and store the private key in a secrets manager.
  </Step>

  <Step title="Register your merchant account">
    [Merchant Registration](/integration/merchant-registration). Send your public key to Blink.
  </Step>

  <Step title="Harden your signer">
    [Signer Endpoint](/integration/signer-endpoint). Add request validation, authentication, rate limiting, and CORS.
  </Step>

  <Step title="Handle errors gracefully">
    [Error Handling](/sdk-reference/errors). Use `DepositError` codes and `getDisplayMessage()` in your UI.
  </Step>

  <Step title="Run the production checklist">
    [Production Checklist](/integration/production-checklist). Verify every item before going live.
  </Step>
</Steps>
