Skip to main content
The Stripe integration handles checkout sessions, billing portals, and subscription webhooks. It calls Stripe’s REST API directly (no stripe npm package needed). The stripe() plugin exposes HTTP endpoints. The plugin does not add theauth.stripe to the instance, so to call the methods from your own code you create the module yourself (see Usage).

Setup

1

Get your keys

From Stripe Dashboard, copy your Secret Key. Under Webhooks, create an endpoint pointing to /api/theauth/auth/stripe/webhook and copy the Signing Secret.
2

Configure the plugin

The secretKey and webhookSecret options are both required. Other options: autoCreateCustomer (default true), apiVersion (default 2024-12-18.acacia), and the onSubscriptionChange(userId, subscription) callback. The checkout, portal and subscription endpoints act on the authenticated user, resolved from auth.adapter or an auth.session token.

Usage

Create the module with the same config and your instance’s database. You can build it once and share it with the plugin config.

Create a checkout session

Always pass successUrl and cancelUrl. If you omit successUrl, it falls back to a placeholder (https://example.com/success).

Open the billing portal

Check subscription status

Webhook events

The plugin handles these Stripe events automatically: Other event types are acknowledged and ignored. Webhook signatures are verified using HMAC-SHA256. Timestamps more than 5 minutes from the current time are rejected. A missing or invalid signature returns 400.

Endpoints

Database columns

These Stripe columns are part of the users table that theAuth creates (they are not added by the plugin):
webhookSecret is required. Webhook events whose signature does not verify against it are rejected.

Polar payment

Alternative billing integration using Polar subscriptions and webhooks.

Organizations

Manage org membership alongside subscription status.

API keys

Issue scoped API keys for server-to-server billing integrations.

Hooks

Lifecycle hooks you can attach to your instance. For subscription changes use the onSubscriptionChange callback.
Last modified on October 7, 2026