Developers

Ingest events. Trigger everything.

Typed SDK for signups, purchases, and custom events. Flows, segments, RFM, and AI agents react the moment behavior hits your CRM.

Why events

Product behavior is the best signal.

Chat tells you who asked. Events tell you who signed up, activated, purchased, or churned — so automation acts on facts, not guesses.

  • +One customer profile across web, app, and chat
  • +Flows trigger on Purchase, TrialExpired, or your custom schemas
  • +RFM and segments stay accurate when Purchase events include amount
Signup+62***
PurchaseRp 150k
TrialExpiredday 14
FeatureUsedonboarding
Quickstart

Ship tracking in minutes.

Register schemas once at startup. Track with full TypeScript inference — no stringly-typed event names.

01Install osbisnis-zod02Define & register events03Track from your app
osbisnis-zod
pnpm add osbisnis-zod zod

// events.ts
import { eventSchema, builtinEvents } from 'osbisnis-zod'
import { z } from 'zod'

export const purchase = builtinEvents.purchase.extend({
  plan: z.enum(['free', 'pro']).optional(),
})

export const signup = eventSchema('Signup', z.object({
  source: z.enum(['organic', 'ads', 'referral']),
}))

// crm.ts — call once at startup
import { createClient } from 'osbisnis-zod'
import * as events from './events'

export const crm = createClient({
  apiKey: process.env.CRM_API_KEY!,
  baseUrl: 'https://your-org.osbisnis.com',
})

await crm.registerEvents(events)

// checkout.ts
await crm.track(purchase,
  { email: 'user@example.com', whatsapp: '+62812345678' },
  { amount: 150000, productName: 'Pro plan', plan: 'pro' }
)
Built-in events

Purchase powers RFM & revenue.

Use builtinEvents.purchase — extend with your own fields. Wrong event names break analytics silently; the SDK keeps you on contract.

Required property: amount (number) for monetary scoring.

Purchase
import { builtinEvents } from 'osbisnis-zod'

await crm.track(builtinEvents.purchase,
  { email: 'user@example.com' },
  { amount: 150000, productName: 'Order #123' }  // required for RFM
)
Event-driven flows

Behavior in → action out.

When a Purchase, Signup, or custom event arrives, flows branch on properties, wait, split audiences, and message across channels.

  • Trigger on any registered event with property conditions
  • Use event.* and customer.* variables in message templates
  • Same engine powers chat-native and product-led teams
flow trigger
// Flow trigger: Purchase where amount > 100000
// → wait 2h → WhatsApp reminder if unpaid
// → branch on customer.tier

Trigger: Purchase
  ├─ condition: event.amount > 0
  ├─ delay: 2 hours
  ├─ message: WhatsApp template
  └─ split: customer.tier === 'gold' ? upsell : nurture
MCP

Your agent steers the CRM.

Claude Code, Codex, and Cursor connect via MCP — query segments, schedule broadcasts, and adjust campaigns without clicking through admin UI.

Build on OsBisnis

Get your API key.

Create an org, generate an API key in settings, and start tracking from staging today.