Quick Start (5 minutes)
Developer tracks their first event and reads a wallet balance in under 5 minutes.
Prerequisites
- Node.js 18+ installed
- A SettleSettle account (sign up free)
- A Next.js or Node.js project to drop this into
Step 1 — Install the SDK
bash
npm install settlesettle
# or
pnpm add settlesettleStep 2 — Get your API key
- Go to your SettleSettle Dashboard
- Click Create App
- Name your app (e.g. "My AI Tool")
- Copy the API key — it starts with
ss_live_
The raw API key is shown once only. Save it in your
.env immediately.Step 3 — Add it to your environment
bash
# .env
SETTLESETTLE_API_KEY=ss_live_your_key_hereStep 4 — Initialize the SDK
typescript
// lib/settle.ts
import { SettleSettle } from 'settlesettle'
if (!process.env.SETTLESETTLE_API_KEY) {
throw new Error('SETTLESETTLE_API_KEY is not set')
}
export const settle = new SettleSettle({
apiKey: process.env.SETTLESETTLE_API_KEY,
})Step 5 — Track your first event
typescript
import { settle } from '@/lib/settle'
export async function handleAiQuery(userId: string, prompt: string) {
const result = await runAiModel(prompt)
// Tell SettleSettle this billable action happened
// Non-blocking — this never slows down your response
settle.events.track({
userId,
eventType: 'AI_QUERY',
})
return result
}Step 6 — Check a user's wallet balance
typescript
const { balance } = await settle.wallet.getBalance(userId)
if (balance <= 0) {
throw new Error('No credits remaining.')
}✅ Success state:
Events appear in your SettleSettle dashboard under your app within seconds. Under the hood, all signals are dispatched straight to our secure API root at https://api.settlesettle.uno/v1.
#### What's next
