better-auth-integration

Integrates Dodo Payments checkout, portal, usage, and webhooks into Better Auth applications.

6|1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/dodopayments/dodo-agent-plugin --skill better-auth-integration-dodopayments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-integration
Source: https://github.com/dodopayments/dodo-agent-plugin/tree/main/plugins/dodopayments/skills/better-auth-integration
Command: npx skills add https://github.com/dodopayments/dodo-agent-plugin --skill better-auth-integration-dodopayments

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dodopayments/better-auth, dodopayments, better-auth.

What problem does it solve? Applications built on Better Auth need to connect authenticated users to Dodo Payments billing without exposing API keys in the browser or writing custom customer-sync, checkout, and webhook plumbing by hand. ## Core Features & Use Cases - Automatic customer sync: Create a Dodo Payments customer when a Better Auth user signs up via createCustomerOnSignUp and getCustomerParams. - Authenticated billing endpoints: Expose checkout sessions, customer portal, subscription and payment lists, and metered usage ingestion through the @dodopayments/better-auth plugin. - Verified webhooks: Receive signature-verified Dodo webhook events at /dodopayments/webhooks with Standard Webhooks verification handled by the plugin. - Use Case: A SaaS app using Better Auth adds a premium-plan product slug, lets signed-in users start checkout from the browser client, and grants entitlements only from verified webhook events. ## Quick Start Ask your agent to set up the @dodopayments/better-auth plugin in my Better Auth config with checkout, portal, usage, and webhooks enabled.

Frequently Asked Questions about better-auth-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Dodo Payments checkout to a Better Auth app?

Install @dodopayments/better-auth, dodopayments, and better-auth, then register the dodopayments plugin with checkout() in its use array. Map product slugs to Dodo product IDs and call authClient.dodopayments.checkoutSession from the browser to start checkout.

How do I sync Better Auth users with Dodo Payments customers?

Set createCustomerOnSignUp: true in the dodopayments plugin options so a Dodo customer is created automatically when a user signs up. Use getCustomerParams to attach metadata such as the Better Auth user ID, and avoid calling client.customers.create() separately.

Why does my Dodo Payments Better Auth route return 404?

Each endpoint only exists if its feature is registered in the plugin's use array. Enabling only portal() means checkout, usage, and webhook routes do not exist; add checkout(), usage(), and webhooks() to register their routes.

How do I verify Dodo Payments webhooks with Better Auth?

Register webhooks({ webhookKey, onPayload }) in the plugin and point the Dodo dashboard at /api/auth/dodopayments/webhooks. The plugin verifies the Standard Webhooks signature itself; do not create a second route or custom verifier.

Can I call Dodo Payments endpoints from the browser with Better Auth?

Yes, use authClient.dodopayments methods from the dodopaymentsClient plugin, which send the Better Auth session cookie automatically. Do not pass request headers to these browser methods, and use Better Auth's server API separately for server-side handling.