SolydFlow Quickstart
Get your application processing verified subscriptions and granting entitlements in under 10 minutes.
Prerequisites
- A SolydFlow Console account.
- An active merchant account with at least one supported payment provider (e.g., Paystack, Flutterwave, or Stripe in Test or Live mode).
- A Flutter application or modern JavaScript/TypeScript web app.
1. Create a Project & Retrieve API Keys
- Log in to the SolydFlow Console and select New Project.
- Name your project (e.g.,
Apex SaaS). - Navigate to Settings → API Keys and copy your Public Key:
- Test Mode:
sf_pk_test_... - Live Mode:
sf_pk_live_...
- Test Mode:
2. Connect Your Payment Provider (BYOK)
SolydFlow uses a Bring Your Own Keys (BYOK) model. You retain direct ownership of your merchant accounts, customer relationships, and bank payouts.
- Go to Settings → API Credentials Vault.
- Select your gateway (e.g., Paystack, Flutterwave, or Stripe).
- Paste your gateway's Secret Key (
sk_test_.../sk_live_...) and click Save. - Copy the unique Inbound Gateway Webhook URL generated in the console and paste it into your payment gateway’s webhook settings dashboard.
3. Configure Entitlements and Packages
In SolydFlow, access permissions are separated from billing items:
- Navigate to Entitlements → Create Entitlement.
- Identifier:
pro_access - Description: Full access to premium features
- Identifier:
- Navigate to Products → Create Package.
- Package Identifier:
pro_monthly - Mapped Entitlement:
pro_access - Base Price:
₦5,000(NGN),KSh 500(KES), or$4.99(USD)
- Package Identifier:
4. Install the SDK
- Flutter
- JavaScript / TypeScript
Add solydflow_flutter to your pubspec.yaml:
pubspec.yaml
dependencies:
flutter:
sdk: flutter
solydflow_flutter:
git:
url: https://github.com/solydflow/solydflow_flutter.git
path: sdk_flutter
ref: v0.8.0
Then run:
flutter pub get
Install solydflow-js via your preferred package manager:
npm install solydflow-js
# or
yarn add solydflow-js
# or
pnpm add solydflow-js
5. Initialize SolydFlow
Initialize the SDK as early as possible in your app lifecycle after the user signs in:
- Flutter
- JavaScript / TypeScript
lib/main.dart
import 'package:flutter/material.dart';
import 'package:solydflow_flutter/solydflow_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize SolydFlow with your Public Key and authenticated User ID
await SolydFlow.configure(
apiKey: "sf_pk_test_a8f93b1c8e924a1b82",
userID: "usr_firebase_992182",
userEmail: "customer@example.com",
userPhone: "+2348012345678", // Recommended: Enables M-Pesa & SMS recovery
);
runApp(const MyApp());
}
src/index.ts
import { SolydFlow } from "solydflow-js";
await SolydFlow.configure(
"sf_pk_test_a8f93b1c8e924a1b82",
"usr_db_992182",
"customer@example.com"
);
6. Make a Purchase & Check Access
- Flutter
- JavaScript / TypeScript
lib/screens/checkout_example.dart
import 'package:flutter/material.dart';
import 'package:solydflow_flutter/solydflow_flutter.dart';
Future<void> handleSubscription(BuildContext context) async {
try {
// 1. Trigger the checkout flow for your package identifier
final CustomerInfo? info = await SolydFlow.purchasePackage(
context,
"pro_monthly",
);
if (info == null) {
// User dismissed or cancelled the modal
return;
}
// 2. Check if the entitlement is unlocked
if (info.activeEntitlements["pro_access"] == true) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text("🎉 Pro Access Activated!")),
);
}
} catch (error) {
debugPrint("Purchase failed: $error");
}
}
// 3. Fast offline entitlement check (<5ms) anywhere in your app
Future<bool> checkUserAccess() async {
return await SolydFlow.hasEntitlement("pro_access");
}
src/checkout.ts
import { SolydFlow } from "solydflow-js";
// 1. Trigger hosted web checkout redirect
async function buyPlan(packageId: string) {
try {
await SolydFlow.purchasePackage(
packageId,
"+2348012345678" // Customer phone
);
} catch (err) {
console.error("Checkout redirection failed:", err);
}
}
// 2. Check entitlement state in web application
async function verifyAccess(): Promise<boolean> {
return await SolydFlow.hasEntitlement("pro_access");
}
7. Test in Sandbox & Go Live
- Use test card numbers or mobile money test prompts to simulate successful and failed payments in Test Mode (
sf_pk_test_...). - Verify that
pro_accessis granted in the console's Customers tab. - Switch your API keys to Live Mode (
sf_pk_live_...) in your production environment.