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.
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.
Installation
1
Install the Package
- Android
- iOS
- Expo
The package is autolinked and pulls No additional setup needed; the native dependency is resolved automatically.
com.dodopayments.api:checkout-android from Maven.2
Register a Callback URL Scheme
Your app must register a URL scheme to receive the return URL from the checkout.
- Android (Gradle)
- iOS (Info.plist)
- Expo (both platforms)
In Replace
android/app/build.gradle:android/app/build.gradle
"myapp" with your app’s scheme.Usage
Forwarding the Return URL
TheLinking 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
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.result.status alone.
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 acheckout.dodopayments.comsession 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.Related
Mobile Integration Guide
The same contract for Android, iOS, and Flutter.
Expo Boilerplate
A complete Expo example with checkout integration.