Loading...
Loading...
Skill for integrating Autumn - the billing and entitlements layer over Stripe.
npx skill4agent add useautumn/skills autumn-best-practicesAUTUMN_SECRET_KEYnpm install autumn-js # Node.js
pip install autumn-py # Python| Method | Purpose |
|---|---|
| Create or get customer (idempotent) |
| Get Stripe URL or payment preview |
| Confirm purchase (card on file) |
| Cancel subscription |
| Verify feature access |
| Record usage |
| Get products with billing scenarios |
| Option | Notes |
|---|---|
| Required. From env |
| Optional. Defaults to |
const { data } = await autumn.check({ customer_id, feature_id: "api_calls" });
if (!data.allowed) return { error: "Limit reached" };
const result = await doWork();
await autumn.track({ customer_id, feature_id: "api_calls", value: 1 });
return result;const { data } = await autumn.checkout({ customer_id, product_id: "pro" });
if (data.url) return redirect(data.url); // New customer → Stripe
// Returning customer → show confirmation, then:
await autumn.attach({ customer_id, product_id: "pro" });products.list| Scenario | Meaning |
|---|---|
| Not subscribed |
| Currently on plan |
| Scheduled for future |
| Higher tier available |
| Lower tier available |
| Cancelled, can reactivate |
| Type | Behavior |
|---|---|
| Access granted or denied |
| Usage tracked against limit |
| Pool for multiple features |
| Hook | Purpose |
|---|---|
| Get customer, checkout, attach, check |
| Get products with scenarios |
import { AutumnProvider } from "autumn-js/react";
<AutumnProvider>{children}</AutumnProvider>| Framework | Import |
|---|---|
| Next.js | |
| React Router | |
| Hono | |
| Express | |
| Fastify | |
| Generic | |
data.urldata.checkout_urlattach({ product_id: "free" })cancel()customers.create