Quickstart
Get up and running with MonkeyHub in under 5 minutes.
1. Install the SDK
bash
npm install @monkeyhub/sdk2. Get your API key
Sign up at monkeyhub.io, then go to Dashboard → API Keys and create a secret key (mk_live_).
Warning: Never expose your
mk_live_ key in client-side code. Use mk_pub_ keys for browser-safe read-only access.3. Initialize the client
typescript
import { Monkey } from '@monkeyhub/sdk'
const db = new Monkey('mk_live_your_api_key')4. Save data
Create a collection and save your first item. Collections are created automatically on first use.
typescript
// Declare a collection with an index on "email"
const users = db.collection('users', { indexes: ['email'] })
// Save an item — upserts by ID
await users.save({
id: 'user_01',
email: 'jerry@monkey.io',
name: 'Jerry',
role: 'admin',
})5. Read it back
typescript
// Fetch by ID
const jerry = await users.findOne('user_01')
// → { id: 'user_01', email: 'jerry@monkey.io', name: 'Jerry', role: 'admin' }
// Query by indexed field
const result = await users.query({
key: { email: { '=': 'jerry@monkey.io' } }
})
// → { items: [{ id: 'user_01', ... }], cursor: undefined }Next steps
- MonkeyDB — queries, indexes, pagination, and limits
- MonkeyTasks — durable task scheduling with cron and webhooks
- MonkeyBuckets — file uploads with CDN and signed URLs
- CLI — shell access for collections, tasks, buckets, and boxes
- MCP Server — connect AI agents to your backend
- SDK Reference — full API, error handling, and retry behavior