SDK Overview
One consistent purchase API across iOS, Android, React Native, Flutter, and the web.
CashSDK ships a native SDK for every platform your app runs on. Each one wraps the platform store — StoreKit 2 on Apple, Play Billing on Android, Stripe on the web — behind a single, identical API. Learn it once and it looks the same in Swift, Kotlin, TypeScript, and Dart.
Every SDK does the same four things: fetch offerings, run a purchase,
read entitlements, and keep a customer in sync across devices with
identify. Receipts are validated server-side, so your client never has to
trust the store transaction on its own.
Pick your platform#
Swift and SwiftUI, built on StoreKit 2.
Kotlin coroutines over Play Billing v7.
One TypeScript API for iOS and Android.
A single Dart package for every target.
Stripe checkout with unified entitlements.
Zero to a validated purchase in 15 minutes.
Platforms at a glance#
| Platform | Package | Native layer |
|---|---|---|
| iOS | github.com/cashsdk/cashsdk-ios (SPM) | StoreKit 2 |
| Android | com.cashsdk:cashsdk-android:1.0.0 | Play Billing v7 |
| React Native | @cashsdk/react-native | StoreKit 2 + Play Billing |
| Flutter | cashsdk | StoreKit 2 + Play Billing |
| Web | @cashsdk/web | Stripe (and other web processors) |
The shared API#
The same five calls power every integration. Configure once with your publishable key, then work with offerings, purchases, and entitlements.
import CashSDK
CashSDK.configure(apiKey: "pk_live_...")
let offering = try await CashSDK.offerings()
let result = try await CashSDK.purchase(offering.monthly)
if result.entitlements["pro"]?.isActive == true {
unlockPro()
}
try await CashSDK.restorePurchases()
CashSDK.identify("u_812")
import com.cashsdk.CashSDK
CashSDK.configure(apiKey = "pk_live_...")
val offering = CashSDK.offerings()
val result = CashSDK.purchase(offering.monthly)
if (result.entitlements["pro"]?.isActive == true) unlockPro()
CashSDK.restorePurchases()
CashSDK.identify("u_812")
import { CashSDK } from "@cashsdk/react-native";
CashSDK.configure({ apiKey: "pk_live_..." });
const offering = await CashSDK.offerings();
const result = await CashSDK.purchase(offering.monthly);
if (result.entitlements.pro?.isActive) unlockPro();
await CashSDK.restorePurchases();
CashSDK.identify("u_812");
import 'package:cashsdk/cashsdk.dart';
await CashSDK.configure(apiKey: 'pk_live_...');
final offering = await CashSDK.offerings();
final result = await CashSDK.purchase(offering.monthly);
if (result.entitlements['pro']?.isActive == true) unlockPro();
await CashSDK.restorePurchases();
CashSDK.identify('u_812');
The building blocks#
- Configure — call once on launch with your
pk_live_…(orpk_test_…) publishable key. Secret keys (csk_sk_…) are backend-only and must never ship in a client app. - Offerings — the packages you present on a paywall (
monthly,annual, and so on), managed remotely so you can change pricing without a release. - Purchase — runs the native store flow and validates the receipt server-side, returning the customer's updated entitlements.
- Entitlements — the access a customer has right now (
pro,premium). CheckisActiveto gate features. - Identify — link the SDK to your own
app_user_idso entitlements follow a customer across devices and platforms.
New to the model? Read Concepts for how products, entitlements, offerings, paywalls, and customers fit together.