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: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:
4
Verify Account with OTP
Complete account verification using the OTP sent to the user’s email:
5
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.6
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.