Skip to main content
The Cesto SDK (@cesto/sdk) is a typed TypeScript client for Cesto’s read-only API. Use it to list and inspect baskets (products) and to look up a user’s positions by their Solana wallet — all behind a single API key.

Products

List baskets and fetch full basket detail, optionally with backtested performance and charts.

Positions

Read a user’s open and closing positions by their external Solana wallet address.

Fully typed

Every method and response is typed. Ships ESM + CommonJS with bundled type definitions.

Resilient

Automatic retries with backoff, request timeouts, and a typed error hierarchy out of the box.

Requirements

  • Node.js 18+ (uses the global fetch).
  • Server-side only — the SDK uses a secret API key and refuses to run in a browser.
Never use the SDK in browser / client-side code — your secret key would be exposed to end users. It is meant for backends, scripts, and serverless / edge functions.

Install

npm install @cesto/sdk

Quickstart

import { Cesto } from '@cesto/sdk';

const cesto = new Cesto({ apiKey: process.env.CESTO_API_KEY });

// List baskets
const products = await cesto.products.list();

// Fetch one basket by slug
const product = await cesto.products.get('my-basket-slug');

// Look up positions by external Solana wallet
const { positions } = await cesto.positions.list({
  wallet: 'EXTERNAL_SOLANA_ADDRESS',
});
You need an API key to use the SDK. See Authentication to request one.

Next steps

Authentication

Get a key and choose your environment.

Configuration

Client options, timeouts, and retries.

Products

List and fetch baskets.

Positions

Positions by wallet.