SDKs
Install an official Mainly client for TypeScript, Go, or Rust.
Mainly's official SDKs provide typed requests and responses, authentication, timeouts, and automatic retries on top of the same REST API documented here. You can still use any HTTP client if an SDK is not the right fit.
| Language | Package | Install |
|---|---|---|
| TypeScript | @mainly-live/sdk | pnpm add @mainly-live/sdk |
| Go | github.com/mainly-live/mainly-go | go get github.com/mainly-live/mainly-go@latest |
| Rust | mainly | cargo add mainly |
All three SDKs support Solana mainnet and devnet, plus Ethereum mainnet and Sepolia, through a single client.
Before you start
Create an API key in the dashboard and expose it to your server process as
MAINLY_API_KEY:
export MAINLY_API_KEY="mnly_live_..."Treat the key like a password. Do not embed it in browser JavaScript, mobile application bundles, public repositories, or logs.
Choose a client
- TypeScript SDK — Node.js and TypeScript applications.
- Go SDK — Go services and command-line tools.
- Rust SDK — Rust services and applications using async Rust.
Each guide makes the same Solana balance request, so it is easy to compare the clients. For endpoint behavior and response fields, use the API reference.
Source repositories
The generated SDK sources are available on GitHub: