Flutter SDK for Dart
Add install tracking and purchase attribution to your Flutter app. Single codebase, full attribution support for both iOS and Android.
Quick start
Track your first install in under 5 minutes.
import 'package:appfiliate/appfiliate.dart';
// In main() or initState():
Appfiliate.configure(appId: 'APP_ID', apiKey: 'API_KEY');
await Appfiliate.trackInstall();Get your App ID and API Key from your Appfiliate dashboard.
Integration guide
Step-by-step instructions to integrate the Appfiliate Flutter SDK.
Add the dependency
Add to your pubspec.yaml:
dependencies:
appfiliate: ^1.0.0Then run:
flutter pub getConfigure and track installs
Find your main() function or your main widget's initState. Add the following:
import 'package:appfiliate/appfiliate.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Appfiliate.configure(appId: 'APP_ID', apiKey: 'API_KEY');
await Appfiliate.trackInstall();
runApp(const MyApp());
}trackInstall() only fires once per install — it's safe to call on every launch.
Track purchases (optional)
After a successful in-app purchase, call trackPurchase():
await Appfiliate.trackPurchase(
productId: 'premium_monthly',
revenue: 9.99,
currency: 'USD',
transactionId: purchaseDetails.purchaseID,
);Set user ID for webhooks (optional)
If you use RevenueCat, Superwall, Adapty, Qonversion, or Stripe, link the user ID so purchases are attributed automatically:
// RevenueCat example
await Appfiliate.setUserId(await Purchases.appUserID);
// Stripe example
await Appfiliate.setUserId(stripeCustomerId);Automatic Purchase Tracking
RevenueCat webhook integration
Connect RevenueCat and every purchase, renewal, and cancellation is attributed automatically. No manual trackPurchase() calls needed.
1. Add one line of code
Appfiliate.configure(appId: 'APP_ID', apiKey: 'API_KEY');
await Appfiliate.trackInstall();
await Appfiliate.setUserId(await Purchases.appUserID);2. Paste the webhook URL
In your RevenueCat dashboard, go to Integrations → Webhooks and paste:
https://us-central1-appfiliate-5a18b.cloudfunctions.net/api/v1/webhooks/revenuecatAlso works with Superwall, Adapty, Qonversion, and Stripe.
Start tracking Flutter installs today
3 lines of code. Cross-platform iOS and Android support. Free plan included.