Skip to main content
Dodo Payments provides official framework adaptors that simplify payment integration. Each adaptor is designed to work seamlessly with your framework’s conventions, offering checkout, customer portal, and webhook handling out of the box.
Framework adaptors let you integrate Dodo Payments in under 10 lines of code. They handle authentication, request parsing, and response formatting automatically.

Available Framework Adaptors

Choose the adaptor that matches your framework:

Core Features

All framework adaptors provide these built-in capabilities:
FeatureDescription
Checkout HandlerSupport for static, dynamic, and session-based checkout flows
Customer PortalPre-built handler for subscription and billing management
Webhook HandlerSecure signature verification with typed event handlers
Environment ConfigSimple setup via environment variables
Type SafetyFull TypeScript support with typed payloads

Quick Start

Get started with any framework adaptor in three steps:
1

Install the Adaptor

Use your package manager to install the framework-specific adaptor:
npm install @dodopayments/nextjs
2

Configure Environment Variables

Add your Dodo Payments credentials to your environment:
DODO_PAYMENTS_API_KEY=your-api-key
DODO_PAYMENTS_WEBHOOK_KEY=your-webhook-secret
DODO_PAYMENTS_RETURN_URL=https://yourdomain.com/checkout/success
DODO_PAYMENTS_ENVIRONMENT="test_mode" # or "live_mode"
Never commit your .env file or secrets to version control.
3

Create Route Handlers

Set up your checkout, customer portal, and webhook routes:
// app/checkout/route.ts
import { Checkout } from "@dodopayments/nextjs";

export const GET = Checkout({
  bearerToken: process.env.DODO_PAYMENTS_API_KEY,
  returnUrl: process.env.DODO_PAYMENTS_RETURN_URL,
  environment: process.env.DODO_PAYMENTS_ENVIRONMENT,
});
You’re now ready to process payments! Visit the individual adaptor pages for detailed guides and all available options.

Checkout Flow Types

All adaptors support three checkout flow types:
Use static checkout for simple, shareable payment links. Pass the product ID as a query parameter:
/api/checkout?productId=pdt_xxx&quantity=1
Supports optional customer prefill and customization via query parameters.
Use dynamic checkout to programmatically create payments with custom details:
{
  "product_id": "pdt_xxx",
  "customer": {
    "email": "[email protected]",
    "name": "John Doe"
  },
  "quantity": 1
}
Supports both one-time payments and subscriptions.
Use checkout sessions for the most flexible checkout experience with cart support:
{
  "product_cart": [
    { "product_id": "pdt_xxx", "quantity": 1 },
    { "product_id": "pdt_yyy", "quantity": 2 }
  ],
  "customer": {
    "email": "[email protected]"
  }
}
Learn more in the Checkout Sessions Guide.

Webhook Event Handling

All adaptors provide type-safe webhook handling with granular event callbacks:
Webhooks({
  webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_KEY,
  onPayload: async (payload) => {
    // Handle any webhook event
  },
  onPaymentSucceeded: async (payload) => {
    // Handle successful payments
  },
  onSubscriptionActive: async (payload) => {
    // Handle new subscriptions
  },
  // ... 20+ event types supported
});
All webhook handlers automatically verify signatures and validate payloads using Zod schemas. Invalid requests are rejected with appropriate error codes.

Choosing the Right Adaptor

FrameworkBest ForRuntime
Next.jsFull-stack React apps with App RouterNode.js, Edge
NuxtFull-stack Vue.js applicationsNode.js
ExpressREST APIs and traditional Node.js appsNode.js
FastifyHigh-performance APIsNode.js
HonoEdge deployments, Cloudflare WorkersEdge, Node.js
AstroContent sites with server endpointsNode.js, Edge
SvelteKitFull-stack Svelte applicationsNode.js
RemixFull-stack React with nested routingNode.js
TanStack StartType-safe full-stack ReactNode.js
Better AuthApps already using Better AuthVarious
ConvexApps using Convex for backendConvex Runtime

Getting Help

Need assistance with framework adaptors?