Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dodopayments/dodo-adapters

Repository files navigation

Dodo Payments Adapters

Join Discord License: GPLv3

Framework-specific adapters for seamless Dodo Payments integration across web frameworks.

πŸš€ Quick Start

# Choose your framework
npm install @dodopayments/nextjs     # Next.js
npm install @dodopayments/express    # Express
npm install @dodopayments/fastify    # Fastify
npm install @dodopayments/hono       # Hono
npm install @dodopayments/remix      # Remix
npm install @dodopayments/sveltekit  # SvelteKit
npm install @dodopayments/astro      # Astro
npm install @dodopayments/tanstack   # TanStack
npm install @dodopayments/nuxt       # Nuxt
npm install @dodopayments/convex     # Convex
npm install @dodopayments/better-auth # BetterAuth
bun add @dodopayments/bun            # Bun

Basic Setup

// Next.js example - app/api/checkout/route.ts
import { Checkout, Webhooks } from "@dodopayments/nextjs";

export const POST = Checkout({
  bearerToken: process.env.DODO_PAYMENTS_API_KEY!,
  returnUrl: "https://yourapp.com/success",
});

export const POST = Webhooks({
  bearerToken: process.env.DODO_PAYMENTS_API_KEY!,
  webhookSecret: process.env.DODO_WEBHOOKS_SECRET!,
  onPaymentCompleted: async (payload) => {
    // Handle payment success
  },
});

πŸ“¦ Available Adapters

Framework Package Status
Next.js @dodopayments/nextjs βœ…
Express @dodopayments/express βœ…
Fastify @dodopayments/fastify βœ…
Hono @dodopayments/hono βœ…
Remix @dodopayments/remix βœ…
SvelteKit @dodopayments/sveltekit βœ…
Astro @dodopayments/astro βœ…
TanStack @dodopayments/tanstack βœ…
Nuxt @dodopayments/nuxt βœ…
BetterAuth @dodopayments/betterauth βœ…
Convex @dodopayments/convex βœ…
Bun @dodopayments/bun βœ…

πŸ”§ Features

  • 🎯 Framework Agnostic: Unified API across all frameworks
  • πŸ”’ Type-Safe: Full TypeScript support with strict typing
  • ⚑ Easy Integration: Minimal setup, maximum functionality
  • πŸ” Secure: Built-in webhook verification and validation
  • πŸ“Š Complete: Checkout, webhooks, and customer portal

πŸ—οΈ Project Structure

packages/
β”œβ”€β”€ core/                  # Shared functionality and types
β”œβ”€β”€ nextjs/                # Next.js adapter (App & Pages Router)
β”œβ”€β”€ express/               # Express middleware
β”œβ”€β”€ fastify/               # Fastify plugin
β”œβ”€β”€ hono/                  # Hono adapter
β”œβ”€β”€ remix/                 # Remix action/loader support
β”œβ”€β”€ sveltekit/             # SvelteKit hooks
β”œβ”€β”€ astro/                 # Astro endpoints
β”œβ”€β”€ tanstack/              # TanStack Start adapter
β”œβ”€β”€ convex/                # Convex backend component
β”œβ”€β”€ nuxt/                  # Nuxt 3 server routes
β”œβ”€β”€ betterauth/            # BetterAuth plugin
└── bun/                   # Bun server adapter

examples/
β”œβ”€β”€ nextjs-basic/          # Basic Next.js implementation
└── nextjs-betterauth/     # Next.js + BetterAuth integration

πŸ› οΈ Development

Setup

# Clone repository
git clone https://github.com/dodopayments/dodo-adapters.git
cd dodo-adapters

# Install dependencies
npm install

# Build all packages
npm run build

Local Testing

# Build and link the adapter you want to test
cd packages/nextjs  # or any other adapter
npm run build
npm link

# In your test project
npm link @dodopayments/nextjs

### Commands

```bash
# Build all packages
npm run build

# Build specific package
npm run build --filter=@dodopayments/nextjs

# Type checking
npm run check-types

# Linting
npm run lint

# Format code
npm run format

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit changes (git commit -m 'Add amazing feature')
  5. Push to branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

See Contributing Guide for detailed instructions on adding new framework adapters.

🀝 Contributors

Thanks to all our amazing contributors for their support and code!

πŸ“„ License

GPL v3 License - see LICENSE for details.

This project is licensed under the GNU General Public License v3.0. You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.

About

Framework-specific adapters for seamless Dodo Payments integration across web frameworks.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors