Skip to main content
Moonbase provides SDKs for TypeScript/JavaScript, Python, Go, and Ruby. SDKs handle authentication, request formatting, and response parsing. Built-in retries handle rate limits and transient errors.

Prerequisites

Keep API keys secret. Avoid client-side exposure.

Installation and usage

Install the TypeScript SDK using npm:
npm install @moonbaseai/sdk
Usage:
import Moonbase from '@moonbaseai/sdk';

const moonbase = new Moonbase({
  apiKey: process.env.MOONBASE_API_KEY, // This is the default and can be omitted
});

const collection = await moonbase.collections.retrieve('organizations');

console.log(collection.id);

TypeScript SDK on GitHub

View documentation, examples, and source code for the TypeScript SDK.