1import { nova } from "@nova/sdk";23export async function POST(req: Request) {4 const body = await req.json();56 const customer = await nova.customers.create({7 email: body.email,8 plan: "pro",9 metadata: { source: "landing" },10 });1112 await nova.subscriptions.start({13 customer: customer.id,14 trial: 14,15 });1617 nova.webhooks.dispatch(customer);18 return Response.json(customer, { status: 201 });19}Execution traceRunning…
- 00:00.001Request receivedPOST /customers
- 00:00.004Payload validatedPending
- 00:00.018Customer createdPending
- 00:00.032Trial activatedPending
- 00:00.039Webhooks queuedPending
- 00:00.042Response sentPending
Responsewaiting…
{ "id": "cus_9f2a…", "email": "maya@nova.app", "plan": "pro" }Webhooks
- customer.created20038ms
- subscription.started20051ms
- email.queued20212ms
- invoice.upcoming20044ms
- crm.contact.synced20063ms
- analytics.identify2049ms
- workspace.created20127ms
- member.invited20216ms
- permissions.applied2008ms
- trial.activated20022ms
- usage.initialized20114ms
- onboarding.ready20011ms
Built for developers
A typed SDK, predictable REST endpoints and webhooks for everything, so the first integration takes an afternoon.