Skip to main content
Grid Accounts make it simple to build modern fintech applications with email-based onboarding, programmable spending limits, and sub-penny transaction costs. This guide will get you up and running in minutes.
Grid Accounts currently support any Solana token and are compatible with Solana-based programs, providing a powerful base for composability.

Get API Keys

Before you can start building, you’ll need API credentials from the Grid dashboard.

Get API Keys

Visit the Grid dashboard to generate your sandbox and production API keys
Keep your API keys secure and never expose them in client-side code. Always use environment variables or secure key management systems.

Prerequisites

Before integrating Grid Accounts, ensure you have:
  • Node.js 18+ or another runtime environment
  • API credentials from the Grid dashboard
  • Basic understanding of REST APIs and async/await patterns

SDK Installation

Install the official Grid SDK to get started quickly:
The Grid SDK provides TypeScript support out of the box and handles authentication, error handling, and API communication automatically.

Grid SDK Documentation

View complete SDK documentation, API reference, and additional examples on NPM
Migrating from grid-sdk? The new @sqds/grid package provides enhanced features including multi-provider support and React Native compatibility. View our migration guide.

SDK Initialization

Set up your Grid client using the official SDK:
The Grid SDK automatically handles API authentication, request retries, and error formatting. You don’t need to build your own HTTP client.

Complete Integration Example

Complete workflow from account creation through transaction execution:
1

Initialize Grid Client

Set up your Grid SDK client with API credentials:
2

Generate Session Secrets

Create cryptographic keypairs that will authorize all future transactions:
Session secrets contain private keys that enable transaction signing. Store them encrypted and never expose them in client-side code.
3

Create Email Account

Create a new Grid account using email-based onboarding:
Grid accounts do not have the same address in sandbox and production. DO NOT send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.
4

Verify Account with OTP

Complete account verification using the OTP sent to the user’s email:
5

Authenticate Existing Account (Alternative)

For users who already have a Grid account, use the authentication flow:
Use initAuth and completeAuth for existing accounts, or createAccount and completeAuthAndCreateAccount for new account creation. Always generate fresh session secrets for each authentication flow.
6

Prepare Transaction

Before executing, prepare the transaction payload using the SDK:
The transaction_signers field is optional and only required when you need to sign the transaction with additional local signers alongside Grid’s signing.
7

Execute Transactions

Use the signAndSend method to execute the prepared transaction:
The signAndSend method handles both cryptographic signing and network submission in a single call, simplifying transaction execution.
For production applications, implement proper error handling, retry logic, and secure secret management around each of these steps.
Ready to go live? Make sure to update your API endpoints to production URLs and use your production API keys. Grid provides the same API structure across sandbox and production environments.