Quick Start Guide
SolydFlow is the revenue infrastructure for African mobile apps. It unifies Paystack, Flutterwave, Apple IAP, and Google Play into a single API that handles offline entitlements and transaction recovery. Our current implementation are Paystack and Flutterwave, while others are in progress...
Prerequisites
- A SolydFlow Account
- A Flutter App
- A Paystack or Flutterwave Account (Live or Test)
N.B: The docs is undergoing improvement, and more visuals will be added soon for better experience, please bear with us.
Step 1: Configure the Dashboard
Before writing code, we need to define what you are selling.
1. Create a Project
Log in to the SolydFlow Console. Click New Project and give your app a name (e.g., "NaijaFitness").
2. Connect Your Gateway
Inside your project card, you will see a status badge. Click "Connect Gateway".
- Select your provider (Paystack or Flutterwave).
- Enter your Secret Key (starts with
sk_orFLWSECK_).
3. Set Up Pricing (Packages & Entitlements)
Go to the Pricing & Products tab. This is where the magic happens. You need to create "Packages" that unlock "Entitlements".
- Package Identifier: The unique ID for the specific product (e.g.,
gold_monthly,gold_yearly). Whatever name you choose should be the same with the name you will use in your app. - Entitlement ID: The access level the user gets (e.g.,
gold_access).- Note: Both
gold_monthlyandgold_yearlyshould unlock the same Entitlement ID (gold_access).
- Note: Both
Step 2: Install the SDK
Add SolydFlow to your Flutter project's pubspec.yaml:
dependencies:
flutter:
sdk: flutter
# For Alpha Access:
solydflow_flutter:
git:
url: https://github.com/solydflow/solydflow_flutter.git
path: sdk_flutter
ref: main
Android Requirement:
Open android/app/build.gradle and ensure minSdkVersion is 21 or higher.
Step 3: Integrate into your App
1. Initialization
Initialize the SDK in your main.dart.
import 'package:solydflow_flutter/solydflow_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SolydFlow.configure(
apiKey: "sf_live_YOUR_API_KEY", // Found in your Dashboard Project Card
userID: "user_12345" // Your App's logged-in User ID
);
runApp(const MyApp());
}
2. Getting Full User Status (Offline-First)
To get the complete status of a user (including expiry dates and multiple entitlements), use getCustomerInfo.
This method checks the encrypted local cache first. If data exists, it returns instantly (allowing offline access) and syncs with the server in the background.
Future<void> printStatus() async {
// 🚀 Returns instantly from cache if available
CustomerInfo info = await SolydFlow.getCustomerInfo();
// Check specific entitlement
if (info.activeEntitlements['gold_access'] == true) {
print("User is Gold");
}
// Get exact expiry date
DateTime? expiry = info.allEntitlements['gold_access'];
if (expiry != null) {
print("Expires on: $expiry");
}
}
3. Checking Access (The Helper)
For a simple check, you can use the helper method. This also utilizes the local cache.
Future<void> checkAccess() async {
// Check for the "Entitlement ID" you set in Dashboard Step 3
if (await SolydFlow.hasEntitlement("gold_access")) {
print("User is Gold! 💎");
// Navigate to Premium Content
} else {
print("User is Free.");
// Show Paywall
}
}
4. Showing the Paywall
Don't hardcode prices. Fetch them from SolydFlow so you can change prices remotely.
// Returns a list of packages configured in your Dashboard
List<SolydPackage> offerings = await SolydFlow.getOfferings();
// Display in UI
for (var pkg in offerings) {
print("${pkg.name} - ${pkg.currency} ${pkg.amountKobo / 100}");
// e.g., "Gold Monthly - NGN 1000"
}
5. Making a Purchase
When the user taps "Buy", call this method. It handles the Payment UI, Verification, and Error handling.
Future<void> buyPlan(BuildContext context, String packageID) async {
try {
// 1. Trigger Purchase (Opens WebView)
// Returns the updated CustomerInfo immediately upon success
final CustomerInfo? info = await SolydFlow.purchasePackage(context, packageID);
if (info == null) return; // User cancelled or failed
// 2. Check Status Immediately
// The info object contains the new entitlements from the server
if (info.activeEntitlements["gold_access"] == true) {
Navigator.pop(context); // Close Paywall
print("Welcome to the Gold Club!");
}
} catch (e) {
print("Purchase failed: $e");
}
}
Step 4: Testing & Recovery
The "Zombie Transaction" Test
SolydFlow is built for unstable networks. Test the recovery engine:
- Start a purchase on a real device.
- Complete the payment in the WebView.
- Immediately kill the app (swipe it away) before it returns to the success screen.
- Wait 30 seconds.
- Re-open the app.
- The user will automatically have
gold_access(restored via Webhook/Cache sync).
Need Help?
Contact the team at alpha@solydflow.com.