Skip to main content
This is the official Dodo Payments React Native checkout SDK, @dodopayments/react-native-checkout. It opens Dodo’s hosted checkout in a native browser view and returns a typed result. Note: an older, unrelated package named dodopayments-react-native-sdk (unscoped) exists with a completely different API. This page documents the current official scoped package only.

Checkout Sessions API

Create the checkout_url this SDK opens, from your backend.

Mobile Integration Guide

See how this fits into the full mobile payment flow.
The React Native SDK is a thin Turbo Module wrapper over the same native Swift and Kotlin cores. It opens SFSafariViewController on iOS and a Chrome Custom Tab on Android, holds no API key, and never calls the Dodo API directly. All checkout logic runs in the browser; the SDK simply manages the view lifecycle and captures the return URL.
This SDK requires New Architecture only, React Native 0.76+, iOS 16+, and Android minSdk 24.

Installation

1

Install the Package

The package is autolinked and pulls com.dodopayments.api:checkout-android from Maven.
No additional setup needed; the native dependency is resolved automatically.
2

Register a Callback URL Scheme

Your app must register a URL scheme to receive the return URL from the checkout.
In android/app/build.gradle:
android/app/build.gradle
Replace "myapp" with your app’s scheme.

Usage

Forwarding the Return URL

The Linking listener is required for iOS’s return-URL handling. On Android, handleOpenURL is a no-op that resolves false because the Android core handles its redirect natively. It’s safe to register the listener unconditionally on both platforms.

What the Result Means

result.status is a UI hint, not proof of payment. Confirm every payment from your backend, via the payment.succeeded / subscription.active webhook.
CheckoutStatus
required
One of succeeded, failed, cancelled, pending, expired.
string
Set when the return URL included one. Display it in the UI, don’t use it to grant access. See Verify the Payment below.
string
Set for subscription checkouts.
string[]
Set when the checkout includes license key products.
string
Set when the checkout captures an email.
Record<string, string>
Every query parameter from the return URL, verbatim.

Verify the Payment

Webhooks

Dodo Payments calls your backend when a payment succeeds or a subscription activates.

Get Payment Detail

Look up paymentId with your secret key to check its status directly.
Grant access after one of these confirms the payment, never from result.status alone.

Appearance Customization

Customize the checkout browser’s toolbar, buttons, and color scheme via customization on start(...). Options are grouped by platform because Android’s Custom Tab and iOS’s SFSafariViewController expose different native controls. All fields are optional; omitting customization uses each platform’s default appearance.
Color
Toolbar background color.
Color
Navigation bar color.
Color
Divider color above the navigation bar.
'default' | 'back'
default shows the system “X” icon; back draws a back arrow instead.
'start' | 'end'
Which side of the toolbar the close button appears on.
boolean
Shows the toolbar’s share icon.
boolean
Shows the page title under the URL in the toolbar.
boolean
Lets the toolbar auto-hide as the page scrolls.
boolean
Shows “Bookmark this page” in the overflow menu.
boolean
Shows “Download page” in the overflow menu.
'system' | 'light' | 'dark'
Forces light or dark appearance regardless of the device’s system setting.
'done' | 'close' | 'cancel'
Label or icon for the dismiss button.
'pageSheet' | 'fullScreen'
pageSheet presents as a card with swipe-to-dismiss; fullScreen covers the whole screen.
boolean
Lets the toolbar collapse on scroll. Only visible when presentationStyle is fullScreenpageSheet keeps the bars pinned regardless of this setting.
'system' | 'light' | 'dark'
Forces light or dark appearance regardless of the device’s system setting.

Errors

start rejects with a CheckoutError only for misuse or a platform failure. A cancelled or declined payment is always a result, never an exception.
  • INVALID_CHECKOUT_URL: not a checkout.dodopayments.com session URL.
  • INVALID_RETURN_URL: not a valid absolute URL.
  • ALREADY_IN_PROGRESS: a checkout is already running.
  • PLATFORM_ERROR: unexpected platform failure.

Abandoned Sessions

If the app or the JS bundle is killed mid-checkout, the promise is lost but the native layer keeps the session. Recover it on next mount and reconcile it with your backend.

Mobile Integration Guide

The same contract for Android, iOS, and Flutter.

Expo Boilerplate

A complete Expo example with checkout integration.
Last modified on August 8, 2026