# How to Replace Stripe in Your SaaS Boilerplate

> A developer's guide to migrating from Stripe to Dodo Payments in popular SaaS boilerplates like ShipFast, supastarter, and Makerkit to handle global taxes and compliance automatically.
- **Author**: Ayush Agarwal
- **Published**: 2026-03-25
- **Category**: Payments, Developer Tools, How-To
- **URL**: https://dodopayments.com/blogs/replace-stripe-saas-boilerplate

---

SaaS boilerplates have revolutionized how we build startups. Tools like ShipFast, supastarter, and Makerkit provide a massive head start by pre-configuring authentication, database schemas, and UI components. However, almost all of them come with one major assumption: you are going to use Stripe. While Stripe is a fantastic tool, it often leaves solo founders and small teams with a massive administrative burden: global tax compliance. This burden can quickly become a full-time job as your business grows and you start selling to customers in different parts of the world.

If you are selling to customers in the EU, UK, or dozens of other jurisdictions, Stripe alone isn't enough. You either have to use Stripe Tax (which is expensive and only tells you what you owe, without actually remitting it) or integrate a third-party tax service. This is why many developers are looking for [stripe alternatives](https://dodopayments.com/blogs/stripe-alternatives) and [stripe billing alternatives](https://dodopayments.com/blogs/stripe-billing-alternatives) that handle the "Merchant of Record" (MoR) responsibilities. A Merchant of Record is not just a payment processor; it is a legal partner that takes on the liability for your global sales.

In this guide, we will walk through the pattern for replacing Stripe with Dodo Payments in any modern SaaS boilerplate. By making this switch, you can offload global taxes, compliance, and payouts to us, allowing you to focus entirely on your product. We will cover everything from setting up your environment variables to handling complex subscription lifecycles. By the end of this article, you will have a clear understanding of how to build a truly global SaaS without the tax headache.

## Why Replace Stripe? The MoR Advantage

The primary reason to switch is the shift from a "Payment Processor" to a "Merchant of Record." When you use Stripe, you are the legal seller. You are responsible for calculating VAT, GST, and sales tax, collecting it, and remitting it to the proper authorities. This means you need to register for tax IDs in every country where you have significant sales. When you use Dodo Payments, we are the legal seller. We handle all of that for you, using our own tax registrations.

> Most SaaS founders underestimate the cost of tax compliance. It is not just filing returns. It is registration, calculation at checkout, remittance, and audit readiness across every jurisdiction where you have customers.
>
> \- Ayush Agarwal, Co-founder & CPTO at Dodo Payments

Understanding the [stripe vs merchant of records](https://dodopayments.com/blogs/stripe-vs-merchant-of-records) debate is crucial for long-term scalability. As a solo founder, you don't want to spend your weekends filing tax returns in five different countries. By using a [merchant of record for SaaS](https://dodopayments.com/blogs/merchant-of-record-for-saas), you automate the most boring and dangerous part of your business. You also gain access to a team of experts who are constantly monitoring changes in global tax laws, so you don't have to. This peace of mind is invaluable as you scale your business.

## The Migration Pattern: A High-Level Overview

Most boilerplates follow a similar architecture for payments. They have a "billing" service or a set of API routes that handle the entire lifecycle of a customer's payment. This typically includes creating a checkout session, handling webhooks for successful payments, managing subscription state in the database, and providing a portal for users to manage their billing. Each of these components is a potential point of failure if not handled correctly.

To replace Stripe, you need to swap out the Stripe SDK calls with Dodo Payments SDK calls and update your webhook handlers. It's a straightforward process if you follow a systematic approach and avoid common [billing system migration mistakes](https://dodopayments.com/blogs/billing-system-migration-mistakes). You should also take this opportunity to clean up your billing logic and ensure that it is as modular as possible. This will make it easier to add new features or payment methods in the future.

```mermaid
flowchart LR
    A[User Clicks Upgrade] --> B{Boilerplate Logic}
    B --> C[Create Dodo Checkout]
    C --> D[User Completes Payment]
    D --> E[Dodo Webhook Fires]
    E --> F[Update Database State]
    F --> G[User Access Granted]
```

## Step 1: Environment Variables and SDK Setup

First, remove the Stripe secret keys from your `.env` file and add your Dodo Payments credentials. You will need your `DODO_PAYMENTS_API_KEY`. It's a good practice to use different keys for your development and production environments to prevent accidental data corruption. You should also ensure that your environment variables are properly secured and not committed to your version control system.

Next, install the Dodo Payments SDK. The SDK is designed to be lightweight and easy to use, with a focus on developer experience. It provides a clean API for all of Dodo's features, from simple payments to complex subscription management. You can find the latest version of the SDK on npm and the source code on GitHub.

```bash
npm install dodopayments
```

Initialize the client in your billing service:

```javascript
import DodoPayments from "dodopayments";

export const dodoClient = new DodoPayments({
  bearerToken: process.env["DODO_PAYMENTS_API_KEY"],
});
```

## Step 2: Replacing the Checkout Session

In most boilerplates, there is a function like `createCheckoutSession`. You will replace the Stripe session creation with a Dodo Payments payment or subscription creation. This is the moment where the user is redirected to the checkout page to enter their payment details. You want this experience to be as smooth and frictionless as possible to maximize your conversion rate.

**Before (Stripe):**

```javascript
const session = await stripe.checkout.sessions.create({
  payment_method_types: ["card"],
  line_items: [{ price: "price_id", quantity: 1 }],
  mode: "subscription",
  success_url: "...",
  cancel_url: "...",
});
```

**After (Dodo Payments):**

```javascript
const payment = await dodoClient.payments.create({
  product_cart: [{ product_id: "pdt_your_product_id", quantity: 1 }],
  customer: { email: user.email, name: user.name },
  billing: { country: "US" }, // Dodo handles the rest of the tax logic
  payment_link: true,
  return_url: "...",
});
```

For subscriptions, you would use the `subscriptions.create` method. The key advantage here is that Dodo handles the [overlay checkout](https://docs.dodopayments.com/developer-resources/overlay-checkout) or [inline checkout](https://docs.dodopayments.com/developer-resources/inline-checkout) seamlessly, keeping the user on your site. This reduces the "bounce rate" that often occurs when a user is redirected to an external domain for payment.

## Step 3: Updating Webhook Handlers

Webhooks are the most critical part of the migration. You need to ensure that when a payment is successful, your database is updated correctly. Dodo Payments uses a similar webhook structure to Stripe, but with different event names and payload structures. You should carefully map each Dodo event to the corresponding action in your application.

You will need to listen for events like `payment.succeeded` or `subscription.created`. Update your webhook route to verify the Dodo signature and process the payload. Signature verification is essential for security, as it ensures that the webhook actually came from Dodo and not a malicious third party. You can find examples of how to verify signatures in our documentation.

```javascript
// Example webhook handler
export async function POST(req) {
  const body = await req.text();
  const signature = req.headers.get("x-dodo-signature");

  // Verify signature logic here...

  const event = JSON.parse(body);

  switch (event.type) {
    case "payment.succeeded":
      await updateDatabase(event.data.customer.email, "active");
      break;
    case "subscription.created":
      await saveSubscriptionId(event.data.subscription_id);
      break;
  }

  return new Response("ok");
}
```

Refer to the [webhooks documentation](https://docs.dodopayments.com/developer-resources/webhooks) for the exact payload structure.

## Step 4: Managing Subscriptions and Portals

Most boilerplates include a "Customer Portal" where users can cancel or upgrade their plans. Instead of redirecting to the Stripe Billing Portal, you can use Dodo's built-in subscription management features. This allows you to maintain a consistent brand experience throughout the entire customer journey. You can build your own portal using our API or use our pre-built components.

You can retrieve subscription details using the [SDKs](https://docs.dodopayments.com/developer-resources/dodo-payments-sdks) and display them directly in your UI. When a user wants to cancel, you simply call the `subscriptions.cancel` method. This gives you the opportunity to offer a "save" offer, such as a discount or a free month, before they finalize their cancellation. This is a powerful way to reduce churn and increase your customer lifetime value.

```javascript
const canceledSubscription = await dodoClient.subscriptions.cancel("sub_id");
```

This gives you more control over the user experience while still offloading the complex billing logic to Dodo.

## Specific Boilerplate Tips

### ShipFast (Next.js)

ShipFast is designed for speed, and its payment integration is no exception. It uses a `stripe.js` file in the `libs` folder to handle all payment-related logic. You can create a corresponding `dodo.js` file and update the components that call `createCheckout`. Since ShipFast is built for speed, using Dodo's payment links is the fastest way to get up and running. You can simply replace the Stripe checkout URL with your Dodo payment link.

### supastarter (Next.js + Supabase)

supastarter has a very clean abstraction for billing, which makes it easy to swap out the underlying payment provider. You can swap out the Stripe service implementation with a Dodo service. Make sure to update the Supabase schema if you were storing Stripe-specific IDs (like `stripe_customer_id`). You should also update your Supabase edge functions to handle Dodo webhooks. This will ensure that your database remains the "source of truth" for your application state.

### Makerkit (Remix / Next.js)

Makerkit is highly modular and built with scalability in mind. You can replace the Stripe integration by updating the `billing` module. Makerkit's robust webhook handling makes it easy to map Dodo events to your internal application state. You should also take advantage of Makerkit's built-in support for multiple payment providers to make your migration even smoother. This allows you to test Dodo in parallel with Stripe before making the final switch.

## Testing Your Migration

Before going live, use Dodo's test mode to ensure everything is working as expected. You can simulate successful payments, failed transactions, and subscription renewals without using real money. This is the time to ensure your [integration guide](https://docs.dodopayments.com/developer-resources/integration-guide) is followed perfectly and that your database state remains consistent. You should also test your error handling logic to ensure that your users get clear and helpful messages if something goes wrong.

Check your logs for any failed webhooks. Ensure that your [API reference](https://docs.dodopayments.com/api-reference/introduction) calls are returning the expected data. A smooth migration is all about the details. Don't rush the process. Take the time to test every possible scenario, from a simple one-time purchase to a complex subscription upgrade. Your users will thank you for the seamless experience.

## FAQ

### Is Dodo Payments more expensive than Stripe?

While Stripe's base fee is 2.9% + 30c, you often end up paying much more once you add Stripe Tax, Stripe Billing, and the cost of your own time spent on compliance. Dodo's transparent pricing includes the Merchant of Record service, which often makes it more cost-effective for global SaaS.

### Can I migrate my existing Stripe subscribers to Dodo?

Yes, but it requires a bit of planning. You will need to export your customer data from Stripe and import it into Dodo. We recommend running both systems in parallel for a short period to ensure a seamless transition for your users.

### Does Dodo support all the payment methods Stripe does?

Dodo supports all major credit cards, Apple Pay, Google Pay, and dozens of localized payment methods like iDEAL, Bancontact, and Pix. We are constantly adding more to ensure high conversion rates globally.

### Do I still need to register for VAT/GST?

No. When you use Dodo Payments as your Merchant of Record, we are the ones registered for VAT/GST in all the jurisdictions we support. We collect and remit the taxes under our own tax IDs.

### How do I handle payouts?

Dodo Payments collects the funds from your customers and then pays you out in your preferred currency. You can set your payout schedule in the dashboard.

## Final Take

Replacing Stripe in your SaaS boilerplate is one of the best moves you can make for your long-term productivity. It removes the "tax shadow" that hangs over every global sale and simplifies your tech stack. By following the patterns outlined in this guide, you can make the switch in a matter of hours and get back to what matters most: building a product your users love.

Ready to simplify your billing? [Sign up for Dodo Payments](https://dodopayments.com) and start your migration today. Explore our [pricing](https://dodopayments.com/pricing) to see how we help you grow globally without the headache.
---
- [More Payments articles](https://dodopayments.com/blogs/category/payments)
- [All articles](https://dodopayments.com/blogs)