Skip to main content
Framework adaptors add Dodo Payments checkout, Customer Portal, and webhook handlers to your app using your framework’s request and response types. Each adaptor is an npm package in the @dodopayments scope. The packages use @dodopayments/core for checkout validation, Dodo Payments API requests, webhook payload validation, and typed event callbacks.
Each adaptor accepts your API key and environment in its handler configuration. Keep those values in environment variables and pass them when you create the handler.
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:
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 test_mode.
If you don’t pass an environment, the adaptor uses live_mode.
Never commit your .env file or secrets to version control.
3

Create Route Handlers

Create a checkout route. The customer portal and webhook routes follow the same pattern:
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 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 creates a payment link from a JSON body with custom details. billing and customer are required:
It supports both one-time payments and subscriptions. It calls the deprecated POST /payments or POST /subscriptions endpoint, depending on the product type, so use checkout sessions for new integrations.
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 a Webhooks handler. It takes your webhook secret and optional typed callbacks for individual event types. onPayload runs for every event:
The callbacks cover payment, refund, dispute, subscription, license key, abandoned checkout, dunning, credit, entitlement grant, and payout events. The Better Auth plugin accepts the same callbacks in 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:
Last modified on September 26, 2026