API Reference
Paystack Better Auth plugin options.
Options
| Option | Type | Description |
|---|---|---|
checkout? | | One-time checkout lifecycle hooks. undefined |
createCustomerOnSignUp? | | Create a Paystack customer automatically when a user signs up. undefined (optional) |
disablePaymentPersistence? | | Skip persisting one-time payment records to the database (useful for tests). undefined (optional) |
disableWebhookPersistence? | | Skip persisting webhook payloads to the database (useful for tests). undefined (optional) |
getCustomerCreateParams? | | Customize Paystack customer fields before creation. |
onCustomerCreate? | | Called after a Paystack customer is created for a user. |
onEvent? | | Called for every verified Paystack webhook event. |
paystackClient | | The Paystack client to use for authentication. |
schema? | | The schema for the Paystack plugin. undefined |
subscription? | | Subscription billing configuration and lifecycle hooks. undefined |
Subscription options
| Option | Type | Description |
|---|---|---|
enabled? | | Enable subscription billing. false |
onSubscriptionCancel? | | Fires when a subscription is cancelled (including at period end). |
onSubscriptionComplete? | | Fires after the first successful payment completes a subscription checkout. |
onSubscriptionCreated? | | Fires when Paystack sends |
onSubscriptionDeleted? | | Fires when a subscription is permanently deleted/disabled. |
onSubscriptionUpdate? | | Fires on subscription status changes from webhooks or API sync. |
plans? | | Subscription plans exposed for checkout. Pass a static array of SubscriptionPlan definitions, or an async function that returns plans at runtime (for dynamic pricing or entitlements). Each SubscriptionPlan is either auto-created or pre-created:
|
Checkout options
| Option | Type | Description |
|---|---|---|
onCheckoutComplete? | | Fires after a successful one-time checkout payment ( |