1import { nova } from "@nova/sdk";
2
3export async function POST(req: Request) {
4 const body = await req.json();
5
6 const customer = await nova.customers.create({
7 email: body.email,
8 plan: "pro",
9 metadata: { source: "landing" },
10 });
11
12 await nova.subscriptions.start({
13 customer: customer.id,
14 trial: 14,
15 });
16
17 nova.webhooks.dispatch(customer);
18 return Response.json(customer, { status: 201 });
19}
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.