Skip to main content

SDK Overview

The SolydFlow Client SDK connects your mobile and web applications to SolydFlow’s revenue infrastructure.

[1. Configure with User ID] ➔ [2. Fetch Localized Offerings] ➔ [3. Initiate Purchase] ➔ [4. Instant Offline Gating (<5ms)]

Instead of managing payment modals, network timeouts, and token encryption yourself, the SDK automates checkout flows, synchronizes customer state in the background, and caches entitlements locally using hardware-backed AES-GCM encryption.


Supported Client SDKs​

Platform / FrameworkPackage / SourceMinimum OS / RuntimeDocumentation
Flutter (Dart)solydflow_flutterFlutter 3.0+ / Dart 3.0+Flutter SDK →
JavaScript / TypeScriptsolydflow-jsES6+ / Browsers / Node 18+JavaScript SDK →
React Native@solydflow/react-nativeReact Native 0.70+React Native SDK →
iOS (Swift)SolydFlowSwiftiOS 14.0+Swift SDK →
Android (Kotlin)com.solydflow.androidAPI Level 21+ (Android 5.0)Kotlin SDK →

Core SDK API Cheatsheet​

All SolydFlow SDKs expose five core functions:

MethodWhat It DoesPrimary Use Case
configure()Authenticates client and sets user identity.Call immediately after user signs in.
getOfferings()Returns active packages with PPP pricing.Render your custom paywall or pricing table.
purchasePackage()Launches Smart-Routed payment flow.Triggered when user selects a plan.
hasEntitlement()Returns boolean access (<5ms offline check).Protect feature screens, tabs, and actions.
restorePurchases()Re-syncs previous purchases from Apple/Google."Restore Purchases" button in app settings.

Initializing the SDK​

Initialize SolydFlow as early as possible after user authentication:

lib/main.dart
import 'package:flutter/material.dart';
import 'package:solydflow_flutter/solydflow_flutter.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();

await SolydFlow.configure(
apiKey: "sf_pk_live_44019283bc918237fa",
userID: "usr_supabase_991823",
userEmail: "customer@example.com",
userPhone: "+2348012345678", // Enables M-Pesa STK & SMS churn recovery
);

runApp(const MyApp());
}

Simple Access Check vs. Full Customer Profile​

Depending on your UI requirements, SolydFlow provides two ways to read access state:

// Blazing fast (<5ms), reads from encrypted local storage, 100% offline-ready
bool isPro = await SolydFlow.hasEntitlement("pro_access");

2. Full Customer State (For Account & Settings Screens)​

// Returns active entitlements, expiration DateTime, and purchase history
CustomerInfo info = await SolydFlow.getCustomerInfo();
DateTime? expiresAt = info.allEntitlements["pro_access"];

Offline-First Guarantee​

The SDK is built for emerging market network realities:

[App Launch] ➔ [Read Encrypted Local Cache (<5ms)] ➔ [Unlock Features Instantly]
│
▼
[Sync with Server Silently in Background]

Subscribers on airplanes, subways, or unstable cellular networks never see blank screens or loading spinners when opening your app.