Skip to main content
You are done when can() shows used: 1 for a customer. Everything here runs on your backend. React pricing and checkout are covered in Next steps.
1

Get a secret key

Sign up at app.nozle.dev, create a workspace, then open Developers > API keys and create a secret key.
Never put an sk_ key in browser code. A pk_ key can only read the plan catalog, so it cannot send events.
You should have: a key that starts with sk_. Store it as NOZLE_SECRET_KEY in your backend environment.
2

Install the SDK

3

Create the client

The SDKs read NOZLE_SECRET_KEY when you do not pass a key.
nozle.ts
If it fails: Node.js throws Nozle: pass apiKey or set the NOZLE_SECRET_KEY environment variable, Python raises ValueError, and Go panics with nozle: apiKey must not be empty (pass it or set NOZLE_SECRET_KEY). The variable is not set in the process that runs your code.
4

Create a feature, a plan, a customer and a subscription

In the dashboard:
  1. Create a metered feature with code api_calls.
  2. Create a free plan with code quickstart_free. Add the feature with count aggregation and a limit of 10,000.
  3. Create a customer with external ID customer_123.
  4. Activate a subscription for that customer on quickstart_free.
See plans and subscriptions for the screens. This plan is free, so no payment method or cost rating is needed.You should see: customer_123 with one active subscription on quickstart_free.
5

Send your first event

The event name is the feature code, api_calls. Each event adds one to the count; tokens is metadata and does not change it.
You should get: the event’s transaction ID back in Node.js and Python (a UUID string), and no error in Go. Without a subscription ID the SDK looks up the customer’s active subscription, so the call needs exactly one.If it fails:
6

Read it back

You should get: used: 1, limit: 10000 and remaining: 9999.If used is 0: events are processed asynchronously, so wait a few seconds and call can() again. If it stays at 0, check that the event name matches the feature code exactly (api_calls) and that the event was sent for the customer you are reading.can() is a point-in-time check and does not reserve quota. Treat a dependency error as an unavailable decision, not as a denial.

Next steps