Check entitlements.
Cache automatically.

Open-source TypeScript SDK for subscription billing.Stripe, Polar, and more. One typed SDK.

$npm install @fuime/billing-sdk

Define your plans.
Check access anywhere.

lib/billing.tsTypeScript
import { createEnhancedClient } from '@fuime/billing-sdk'import { stripe } from '@fuime/billing-sdk/stripe'const billing = createEnhancedClient({  provider: stripe({ apiKey: process.env.STRIPE_KEY }),  cache: { ttlMs: 60_000 }, // Auto-invalidates on webhooks  plans: {    'prod_pro': { features: ['api', 'export'] },    'prod_enterprise': { features: '*' },  }})
app/api/route.tsTypeScript
// Check feature access (uses cache)if (await billing.hasFeature(userId, 'api')) {  // User has access}// Get entitlement detailsconst ent = await billing.getEntitlement(userId)// { active: true, productId: 'prod_pro', periodEnd: Date }

Features

⚑

Entitlement Cache

Memory or Redis. Configurable TTL. Auto-invalidates when webhooks arrive. Stop hitting Stripe on every request.

🎯

Feature Gating

Declarative plan β†’ features config. Check access with one line. Supports wildcards for enterprise plans.

πŸ””

Webhook Handling

Signature verification, typed events, automatic cache invalidation. All providers normalize to the same event types.

πŸ§ͺ

Mock Adapter

Full state control for testing. Create subscriptions, trigger webhooks, test edge casesβ€”no Stripe sandbox needed.

Providers

Use the billing provider you already have. Your code stays the same.

Stripe
Polar
+ More soon