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](https://console.authdog.com):

1. Select the project and environment.
2. Open **Authentication > Add-ons**.
3. Select **Stripe**.
4. 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 |

5. Enable the add-on and save.

Point the Stripe webhook at:

```url
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:

1. Add the features you want to gate. A feature slug such as `advanced_reports` is what your app checks. Treat it as frozen once it ships.
2. Create a plan: name, slug, and whether it is for a user or an organization.
3. Set the currency and the monthly amount in cents. Add an annual amount only if you sell one.
4. Attach the features the plan grants.
5. 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

1. In the development environment, complete a test-mode checkout.
2. Confirm the subscription status updates after Stripe calls the webhook.
3. Read the entitlements claim from a session issued after the webhook.
4. Repeat with live keys in production only after the test purchase succeeds.

## Related

| Read | To learn how to |
| --- | --- |
| [Billing](/docs/billing) | Plans, checkout, and staying in sync with Stripe |
| [Authentication add-ons](/docs/console/authentication) | Where the Stripe connection lives |
| [Marketplace](/marketplace/stripe) | The listing for this integration |
