Flutter SDK / Install & configure

Install & configure

uplift_funnel_flutter renders Uplift Funnel flows as native Flutter widgets — no WebView. It fetches flow definitions, caches them, and reports funnel events, all behind one widget.

Requirements

  • Dart ^3.4.0, Flutter >=3.16.0
  • iOS only. The renderer is a Swift package this one hosts, so there is no Android target — guard with UpliftFunnel.isSupported, and an unsupported platform throws with an explanation rather than failing deeper.

Install

Terminal
flutter pub add uplift_funnel_flutter

Or add it to your pubspec directly:

pubspec.yaml
dependencies:
  uplift_funnel_flutter: ^0.10.1

Configure

Call UpliftFunnel.configure once at startup, before rendering any flow. Calling identify, track or the rest first fails with a PlatformException whose message names the method — the engine refuses rather than queueing, so a missed configure shows up on the first run instead of as empty analytics weeks later. Registering handlers is the exception: those are held and installed when configure runs, so you can wire them wherever your billing setup lives.

main.dart
import 'package:flutter/material.dart';
import 'package:uplift_funnel_flutter/uplift_funnel_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await UpliftFunnel.configure(
    apiKey: 'fnl_pk_...',        // public key from SDK & API
    appVersion: '2.4.0',         // optional: tags analytics events
  );

  runApp(const MyApp());
}
ParameterTypeDefaultDescription
apiKeyStringRequired. Your app's public key (fnl_pk_...) from the dashboard's SDK & API page. Safe to embed in the client — it can only fetch flows and report events.
serverUrlString?https://api.upliftfunnel.comOverride the API host — useful for local development or staging.
appVersionString?Your app's version string, attached to every analytics event as context, so you can segment funnels by release.

configure is idempotent: calling it again (e.g. after a hot restart) keeps the persisted anonymous ID and any registered handlers.

Local development

dart
// Point a DEBUG build at a local or staging API.
// Passing this from a release build traps: a shipped app has no business
// talking to anything but the production API, and a staging URL left in
// would send real users' events somewhere nobody is looking.
await UpliftFunnel.configure(
  apiKey: 'fnl_pk_...',
  serverUrl: 'http://localhost:3000',
);

Next steps