@dodopayments scope. The packages use @dodopayments/core for checkout validation, Dodo Payments API requests, webhook payload validation, and typed event callbacks.
To have a coding agent add an adaptor for you, install the Agent Plugin.
Available Framework Adaptors
Choose the adaptor that matches your framework:Next.js
Route handlers for checkout, the customer portal, and webhooks in the App Router.
Nuxt
Server route handlers for Nuxt 3, a full-stack Vue framework.
Express
Request handlers for Express 5 routes in Node.js apps.
Fastify
Route handlers for Fastify 5, a Node.js framework with a plugin architecture.
Hono
Route handlers for Hono 4, a web framework for Cloudflare Workers, other edge runtimes, and Node.js.
Astro
Server endpoint handlers for Astro 4 and 5, a content-focused web framework.
SvelteKit
Server route handlers for SvelteKit 2, a full-stack Svelte framework.
Remix
Loader and action handlers for Remix 2, a full-stack React framework.
TanStack Start
Server route handlers for TanStack Start, a type-safe full-stack React framework.
Better Auth
A plugin for the Better Auth authentication framework that adds checkout, portal, usage, and webhook endpoints, and can create a customer at sign-up.
Convex
A component for the Convex backend with checkout and customer portal actions and a webhook HTTP action.
Bun
Native
Bun.serve() handlers for checkout, the customer portal, and webhooks.Core Features
The route handler adaptors share these capabilities:
The Better Auth plugin and the Convex component provide the same capabilities through their own APIs. See their pages for the differences.
Quick Start
Set up a route handler adaptor in three steps.1
Install the Adaptor
Install the package for your framework:
- Next.js
- Nuxt
- Express
- Hono
- Astro
- SvelteKit
2
Configure Environment Variables
Add your Dodo Payments credentials to your environment. Create the API key under Developer → API Keys and the webhook secret under Developer → Webhooks in the dashboard. A test mode API key works only with If you don’t pass an environment, the adaptor uses
test_mode.live_mode.3
Create Route Handlers
Create a checkout route. The customer portal and webhook routes follow the same pattern:
- Next.js
- Express
- Hono
Your checkout route now returns a checkout URL. Each adaptor’s page covers the customer portal and webhook handlers and lists every option.
Checkout Flow Types
The route handler adaptors support three checkout flow types. The Better Auth plugin supports checkout sessions and a deprecated dynamic checkout. The Convex component supports checkout sessions only.Static Checkout (GET)
Static Checkout (GET)
Static checkout returns a payment link for one product, so you can share it or redirect to it. Pass the product ID as a query parameter:The handler checks that the product exists and returns the link as
checkout_url. Optional query parameters pre-fill customer details and control the checkout form.Dynamic Checkout (POST)
Dynamic Checkout (POST)
Dynamic checkout creates a payment link from a JSON body with custom details. It supports both one-time payments and subscriptions. It calls the deprecated
billing and customer are required:POST /payments or POST /subscriptions endpoint, depending on the product type, so use checkout sessions for new integrations.Checkout Sessions (POST)
Checkout Sessions (POST)
Checkout sessions are the recommended flow. They offer the most options and accept a cart with several products:For every supported field, see the Checkout Sessions Guide.
Webhook Event Handling
Every route handler adaptor exports aWebhooks handler. It takes your webhook secret and optional typed callbacks for individual event types. onPayload runs for every event:
webhooks(), and the Convex component accepts them in createDodoWebhookHandler.
Each webhook handler verifies the
webhook-id, webhook-signature, and webhook-timestamp headers with the Standard Webhooks library, then validates the payload with Zod schemas. Invalid requests are rejected with an error status before your callbacks run.Choosing the Right Adaptor
Getting Help
For help with a framework adaptor:- Discord: Ask in the community server.
- Email: Contact support@dodopayments.com.
- GitHub: Open an issue in the dodo-adapters repository, which holds every adaptor.
- Documentation: See the API reference.