Skip to main content
Framework adaptors आपके app में आपके framework के request और response types का उपयोग करके Dodo Payments checkout, Customer Portal और webhook handlers जोड़ते हैं। प्रत्येक adaptor @dodopayments scope में एक npm package है। ये packages checkout validation, Dodo Payments API requests, webhook payload validation और typed event callbacks के लिए @dodopayments/core का उपयोग करते हैं।
प्रत्येक adaptor अपने handler configuration में आपकी API key और environment स्वीकार करता है। इन values को environment variables में रखें और handler बनाते समय उन्हें पास करें।
किसी coding agent से अपने लिए adaptor जोड़ने के लिए Agent Plugin install करें।

उपलब्ध Framework Adaptors

अपने framework से मेल खाने वाला adaptor चुनें:

Next.js

App Router में checkout, customer portal और webhooks के लिए route handlers।

Nuxt

Nuxt 3 के लिए server route handlers, जो एक full-stack Vue framework है।

Express

Node.js apps में Express 5 routes के लिए request handlers।

Fastify

Fastify 5 के लिए route handlers, जो plugin architecture वाला Node.js framework है।

Hono

Hono 4 के लिए route handlers, जो Cloudflare Workers, अन्य edge runtimes और Node.js के लिए web framework है।

Astro

Astro 4 और 5 के लिए server endpoint handlers, जो content-focused web framework हैं।

SvelteKit

SvelteKit 2 के लिए server route handlers, जो full-stack Svelte framework है।

Remix

Remix 2 के लिए loader और action handlers, जो full-stack React framework है।

TanStack Start

TanStack Start के लिए server route handlers, जो type-safe full-stack React framework है।

Better Auth

Better Auth authentication framework के लिए एक plugin, जो checkout, portal, usage और webhook endpoints जोड़ता है और sign-up के समय customer बना सकता है।

Convex

Convex backend के लिए एक component, जिसमें checkout और customer portal actions तथा webhook HTTP action शामिल हैं।

Bun

checkout, customer portal और webhooks के लिए native Bun.serve() handlers।

मुख्य सुविधाएँ

Route handler adaptors में ये क्षमताएँ साझा होती हैं: Better Auth plugin और Convex component अपने APIs के माध्यम से यही क्षमताएँ प्रदान करते हैं। अंतर जानने के लिए उनके pages देखें।

Quick Start

तीन steps में route handler adaptor set up करें।
1

Install the Adaptor

अपने framework के लिए package install करें:
2

Configure Environment Variables

अपने Dodo Payments credentials environment में जोड़ें। Dashboard में Developer → API Keys के अंतर्गत API key और Developer → Webhooks के अंतर्गत webhook secret बनाएँ। Test mode API key केवल test_mode के साथ काम करती है।
यदि आप environment पास नहीं करते हैं, तो adaptor live_mode का उपयोग करता है।
अपनी .env file या secrets को कभी भी version control में commit न करें।
3

Create Route Handlers

Checkout route बनाएँ। Customer portal और webhook routes इसी pattern का पालन करते हैं:
आपका checkout route अब checkout URL लौटाता है। प्रत्येक adaptor का page customer portal और webhook handlers को कवर करता है और हर option की सूची देता है।

Checkout Flow Types

Route handler adaptors तीन checkout flow types support करते हैं। Better Auth plugin checkout sessions और एक deprecated dynamic checkout support करता है। Convex component केवल checkout sessions support करता है।
Static checkout एक product के लिए payment link लौटाता है, इसलिए आप इसे share या redirect कर सकते हैं। Product ID को query parameter के रूप में पास करें:
Handler जाँचता है कि product मौजूद है और link को checkout_url के रूप में लौटाता है। Optional query parameters customer details को पहले से भरते हैं और checkout form को नियंत्रित करते हैं।
Dynamic checkout custom details वाले JSON body से payment link बनाता है। billing और customer आवश्यक हैं:
यह one-time payments और subscriptions दोनों support करता है। Product type के आधार पर यह deprecated POST /payments या POST /subscriptions endpoint को call करता है, इसलिए नए integrations के लिए checkout sessions का उपयोग करें।
Checkout sessions recommended flow हैं। इनमें सबसे अधिक options होते हैं और ये कई products वाला cart स्वीकार करते हैं:
हर supported field के लिए Checkout Sessions Guide देखें।

Webhook Event Handling

प्रत्येक route handler adaptor एक Webhooks handler export करता है। यह आपका webhook secret और individual event types के लिए optional typed callbacks लेता है। onPayload प्रत्येक event के लिए चलता है:
Callbacks payment, refund, dispute, subscription, license key, abandoned checkout, dunning, credit, entitlement grant और payout events को कवर करते हैं। Better Auth plugin इन्हीं callbacks को webhooks() में स्वीकार करता है और Convex component इन्हें createDodoWebhookHandler में स्वीकार करता है।
प्रत्येक webhook handler Standard Webhooks library के साथ webhook-id, webhook-signature और webhook-timestamp headers verify करता है, फिर Zod schemas के साथ payload validate करता है। आपके callbacks चलने से पहले invalid requests को error status के साथ reject कर दिया जाता है।

सही Adaptor चुनना

सहायता प्राप्त करना

Framework adaptor से संबंधित सहायता के लिए:
अंतिम संशोधन 26 सितंबर 2026