Dodo Payments
Dodo Payments is a global Merchant-of-Record platform that lets AI, SaaS and digital businesses sell in 150+ countries without touching tax, fraud, or compliance. A single, developer-friendly API powers checkout, billing, and payouts so you can launch worldwide in minutes.
Get support on Dodo Payments' Discord
This plugin is maintained by the Dodo Payments team.
Have questions? Our team is available on Discord to assist you anytime.
Features
- Automatic customer creation on sign-up
- Type-safe checkout flows with product slug mapping
- Self-service customer portal
- Real-time webhook event processing with signature verification
Get started with Dodo Payments
You need a Dodo Payments account and API keys to use this integration.
Installation
Run the following command in your project root:
Add these to your .env
file:
Create or update src/lib/auth.ts
:
Set environment
to live_mode
for production.
Create or update src/lib/auth-client.ts
:
Usage
Creating a Checkout Session
Accessing the Customer Portal
Listing Customer Data
Webhooks
The webhooks plugin processes real-time payment events from Dodo Payments with secure signature verification. The default endpoint is /api/auth/webhooks/dodopayments
.
Generate a webhook secret for your endpoint URL (e.g., https://your-domain.com/api/auth/webhooks/dodopayments
) in the Dodo Payments Dashboard and set it in your .env file:
Example handler:
Configuration Reference
Plugin Options
- client (required): DodoPayments client instance
- createCustomerOnSignUp (optional): Auto-create customers on user signup
- use (required): Array of plugins to enable (checkout, portal, webhooks)
Checkout Plugin Options
- products: Array of products or async function returning products
- successUrl: URL to redirect after successful payment
- authenticatedUsersOnly: Require user authentication (default: false)
If you encounter any issues, please refer to the Dodo Payments documentation for troubleshooting steps.