HatchedDocs

Hatched documentation

Drop a buddy into your product in under 10 minutes. Server-only SDK, scoped browser tokens, auto-retries, idempotency built in.

Hatched is a gamification layer for B2B products. Events go in, buddies grow. These docs are organised in four tracks — pick the one that matches your mode.

Thirty-second taste

import { HatchedClient } from '@hatched/sdk-js';

const hatched = new HatchedClient({
  apiKey: process.env.HATCHED_API_KEY!,
});

// 1. create a buddy
const egg = await hatched.eggs.create({ userId: 'user_42' });
const op = await hatched.eggs.hatch(egg.eggId);
const finished = await hatched.operations.wait(op.operationId);

// 2. teach the buddy about your product
await hatched.events.send({
  eventId: 'lesson_1_user_42',
  userId: 'user_42',
  type: 'lesson_completed',
  properties: { score: 94 },
});

// 3. mint a browser token and embed the widget
const session = await hatched.widgetSessions.create({
  buddyId: finished.result.buddyId,
  userId: 'user_42',
  scopes: ['buddy:read', 'buddy:interact'],
  ttlSeconds: 900,
});

Full walkthrough: Getting started.

Pick your track

  • Concepts — buddies, skills, coins, streaks, badges, marketplace, evolution, rule engine, auth model.
  • Guides — getting started, SDK quickstart, widgets, events, webhooks, Next.js / Express / edge runtimes, troubleshooting.
  • Reference — HTTP endpoints, full SDK method surface, widget props, webhook payloads, error codes, rate limits, changelog.
  • Platform — architecture, observability, deployment, contributing.

What's new

Always see the latest SDK release notes at Changelog — mirrored from the package itself, produced on every merge.