Skip to main content
The Stripe plugin handles checkout sessions, billing portals, and subscription webhooks. It calls Stripe’s REST API directly (no stripe npm package needed).

Setup

1

Get your keys

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

Configure the plugin

Usage

Create a checkout session

Open the billing portal

Check subscription status

Webhook events

The plugin handles these Stripe events automatically: Webhook signatures are verified using HMAC-SHA256 with constant-time comparison. Stale timestamps (over 5 minutes) are rejected.

Endpoints

Database columns

The plugin adds these columns to the users table:
Set STRIPE_WEBHOOK_SECRET in production. Without it, webhook events cannot be verified and will be rejected.
Last modified on April 29, 2026