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#

Platforms at a glance#

PlatformPackageNative layer
iOSgithub.com/cashsdk/cashsdk-ios (SPM)StoreKit 2
Androidcom.cashsdk:cashsdk-android:1.0.0Play Billing v7
React Native@cashsdk/react-nativeStoreKit 2 + Play Billing
FluttercashsdkStoreKit 2 + Play Billing
Web@cashsdk/webStripe (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.

swift
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")
kotlin
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")
ts
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");
dart
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_… (or pk_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). Check isActive to gate features.
  • Identify — link the SDK to your own app_user_id so entitlements follow a customer across devices and platforms.

Next steps#