SDKsNode SDK
Installation
Install and configure @nozle-js/node
npm install @nozle-js/nodeInitialize the client:
import { Nozle } from '@nozle-js/node';
const nozle = new Nozle({
apiKey: 'sk_live_...',
baseUrl: 'https://api.nozle.app',
eventsUrl: 'https://api.nozle.app',
timeout: 10_000,
});NozleConfig props
- apiKey (
string, required) -- Your secret key (sk_) - baseUrl (
string, default:'http://localhost:8080') -- Nozle API URL - eventsUrl (
string, default:'http://localhost:3000') -- Events ingestion URL (Lago) - timeout (
number, default:10000) -- Request timeout in ms
Available methods
Core
nozle.track()-- send usage eventsnozle.can()-- check entitlementsnozle.ping()-- health check
Billing
nozle.plans()-- list available plansnozle.checkout()-- create Stripe checkout sessionnozle.subscribe()-- create a subscription
Customers & Credits
nozle.customers.upsert()-- create or update a customernozle.checkAndDeduct()-- atomically check and deduct wallet credits
LLM Auto-Capture
wrapOpenAI()-- wrap OpenAI client for automatic token trackingwrapAnthropic()-- wrap Anthropic client for automatic token tracking
Margin Intelligence
nozle.margin.summary()/byCustomer()/byMetric()/byPlan()/byModel()/trend()
Use sk_ (secret) keys only. This SDK is for server-side use.