Usage Metering
Record usage, then try again with the same key — Lumn catches the duplicate and prevents double-billing.
import Lumn from '@lumnsh/stripe';
const lumn = new Lumn(process.env.NEXT_PUBLIC_LUMN_API_KEY);
const customer = await lumn.customers.create({ external_id: 'user_' + Date.now(), email: 'demo@example.com', name: 'Demo User',});Step 1 - Create customer (customers.create)
Parameter reference| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| external_id | string | Required | Your app's user id (stable, unique). | `user_${Date.now()}` |
| string | Required | Customer email. | demo@example.com | |
| name | string | Required | Customer display name. | Demo User |
Interactive UI & Output
Paste your API key above to try
Customize parameters
Provide an existing customer to skip creation. Customize event_name and value for the metering calls.