smartlinks_analytics

Analytics, deep linking, dynamic links, promo codes, and in-app purchase verification for the SmartLinks Flutter SDK.

Recommended: import 'package:smartlinks_flutter/smartlinks_flutter.dart' and use SmartLinks.analytics. Full docs: repository README.

Features

  • Custom event tracking (sendEvent)
  • Deep link handling (getLink, DeepLinkRoute)
  • Short link generation (generateLink)
  • Promo validate / redeem + local premium persistence
  • Apple & Google purchase verification (server-side, with attribution)
  • Anonymous app_user_id

Quick start (umbrella SDK)

import 'package:smartlinks_flutter/smartlinks_flutter.dart';

await SmartLinks.initialize(apiKey: 'YOUR_KEY');

await SmartLinks.analytics.sendEvent('screen_view', {'screen': 'home'});

await SmartLinks.analytics.getLink((route) {
  print(route.route);
});

Promo & purchases

final active = await SmartLinks.isPromoActive();

final valid = await SmartLinks.analytics.verifyGooglePurchase(
  productId: 'premium_monthly',
  purchaseToken: tokenFromStore,
);

final appleOk = await SmartLinks.analytics.verifyApplePurchase(
  receipt: receiptFromStore,
);

Standalone (advanced)

import 'package:smartlinks_analytics/smartlinks_analytics.dart';
import 'package:smartlinks_core/smartlinks_core.dart';

await SmartLinksCore.initialize(apiKey: 'YOUR_KEY');
await SmartLinksAnalytics().initialize(apiKey: 'YOUR_KEY');

Standalone usage still requires smartlinks_core native bridge on mobile.

Platform support

Platform Support
Android ✅ API 21+
iOS ✅ 11.0+

License

MIT — see LICENSE.