Stripe is an Authentication add-on. The same connection bills plans and puts entitlement claims on the tokens Authdog issues. Use a test key in development and a live key in production. Plans never cross environments.
Connect Stripe
In the Authdog console:
- Select the project and environment.
- Open Authentication > Add-ons.
- Select Stripe.
- Fill in:
| Field | Value |
|---|---|
| Entitlements claim name | JWT claim that carries the user's active features. Placeholder stripe_entitlements |
| Publishable key | pk_test_… or pk_live_…. Safe for the browser. Billing components use it to start Stripe.js |
| Secret key | sk_test_… or sk_live_…. Encrypted. Leave blank on later edits to keep the stored key |
| Webhook signing secret | whsec_… from the Stripe webhook endpoint |
- Enable the add-on and save.
Point the Stripe webhook at:
https://api.authdog.com/v1/addons/stripe/webhook/<environmentId>Subscribe it to the subscription events for the same Stripe account you connected. Authdog verifies Stripe-Signature with the signing secret before it updates entitlements.
Define a plan
Open Billing > Plans for the same environment:
- Add the features you want to gate. A feature slug such as
advanced_reportsis what your app checks. Treat it as frozen once it ships. - Create a plan: name, slug, and whether it is for a user or an organization.
- Set the currency and the monthly amount in cents. Add an annual amount only if you sell one.
- Attach the features the plan grants.
- Select Sync to Stripe.
Sync creates the Stripe Product and Prices. An unsynced plan cannot be checked out. Changing an amount mints a new Price. Existing subscribers stay on the Price they bought.
Test it
- In the development environment, complete a test-mode checkout.
- Confirm the subscription status updates after Stripe calls the webhook.
- Read the entitlements claim from a session issued after the webhook.
- Repeat with live keys in production only after the test purchase succeeds.
Related
| Read | To learn how to |
|---|---|
| Billing | Plans, checkout, and staying in sync with Stripe |
| Authentication add-ons | Where the Stripe connection lives |
| Marketplace | The listing for this integration |