Feature Gating

Create a customer and feature, then check permission; render gating UI from entitlements.check result.

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
ParameterTypeRequiredDescriptionExample
external_idstringRequiredYour app's user id (stable, unique).`user_${Date.now()}`
emailstringRequiredCustomer email.demo@example.com
namestringRequiredCustomer display name.Demo User

Interactive UI & Output

Paste your API key above to try

Customize parameters

Provide an existing customer & feature to check entitlements directly. Leave empty to create new ones (will return entitled: false without a subscription).