On this page

API reference

Every public method, with the real signature per platform. Where a method does not exist on a platform the cell says so rather than quietly omitting the row.

What exists where

Method availability across the four SDKs
MethodFlutteriOSAndroidWeb
startyesyesyesyes
identifyyesyesyesyes
setExperimentyesyesyesyes
setEnabledyesyesyesyes
optOutyesyesyesyes
optInyesyesyesyes
flushyesyesyesyes
stopyesyes
clearyes
trackNavigationyes
wrapClientyes
installInIsolateyes
installUrlConnectionCaptureyes
register(on:)yes

Core methods

Present on all four SDKs, with the same meaning everywhere.

start

Install capture. Call once, as early as possible.

start signature on each platform
FlutterDrengr.start({publishableKey, ingestUrl, appPackage, enabled, behavior, maxBodyBytes, …})
iOSDrengr.start(publishableKey:ingestURL:appPackage:startEnabled:behavior:maxBodyBytes:…)
AndroidDrengr.start(context, publishableKey, ingestUrl, appPackage, startEnabled, maxBodyBytes, …): DrengrInterceptor
WebDrengr.start({ publishableKey, ingestUrl, appPackage, enabled, … })

identify

Attach your own stable, non-PII user id. Emits one identify event.

identify signature on each platform
FlutterDrengr.identify(externalId, traits)
iOSDrengr.identify(_ externalId: String, traits: [String: Any] = [:])
AndroidDrengr.identify(externalId: String, traits: Map<String, Any?> = emptyMap())
WebDrengr.identify(externalId, traits)

setExperiment

Record the active A/B variant carried on every later event.

setExperiment signature on each platform
FlutterDrengr.setExperiment(key, variant)
iOSDrengr.setExperiment(_ key: String, variant: String?)
AndroidDrengr.setExperiment(key: String, variant: String?)
WebDrengr.setExperiment(key, variant)

setEnabled

Pause or resume capture in memory. Not persisted.

setEnabled signature on each platform
FlutterDrengr.setEnabled(bool)
iOSDrengr.setEnabled(_ value: Bool)
AndroidDrengr.setEnabled(value: Boolean)
WebDrengr.setEnabled(v: boolean)

optOut

Persistently opt this install out. Survives restarts and outranks start().

optOut signature on each platform
FlutterDrengr.optOut()
iOSDrengr.optOut()
AndroidDrengr.optOut()
WebDrengr.optOut()

optIn

Clear a previous opt-out and resume.

optIn signature on each platform
FlutterDrengr.optIn()
iOSDrengr.optIn()
AndroidDrengr.optIn()
WebDrengr.optIn()

flush

Send anything queued now instead of waiting for the next batch.

flush signature on each platform
FlutterDrengr.flush()
iOSDrengr.flush(completion: (() -> Void)? = nil)
AndroidDrengr.flush(onComplete: Runnable? = null)
WebDrengr.flush()

Platform-only methods

These exist because the underlying platform needs them. Nothing here has a cross-platform equivalent, so reach for them only on the platform that lists one.

stop

Uninstall capture and restore the hooks that were there before.

stop signature on each platform
FlutterDrengr.stop()
iOSnot available
Androidnot available
WebDrengr.stop()

clear

Drop the buffered in-memory event ring, for example on logout.

clear signature on each platform
FlutterDrengr.clear()
iOSnot available
Androidnot available
Webnot available

trackNavigation

Attach to a Jetpack NavController so Compose destinations get real screen names.

trackNavigation signature on each platform
Flutternot available
iOSnot available
AndroidDrengr.trackNavigation(navController: Any): Boolean
Webnot available

wrapClient

Wrap an HttpClient explicitly, for code that builds its own.

wrapClient signature on each platform
FlutterDrengr.wrapClient(client)
iOSnot available
Androidnot available
Webnot available

installInIsolate

Install inside a spawned isolate, which does not inherit HttpOverrides.

installInIsolate signature on each platform
FlutterDrengr.installInIsolate({…})
iOSnot available
Androidnot available
Webnot available

installUrlConnectionCapture

Capture HttpsURLConnection traffic in addition to OkHttp.

installUrlConnectionCapture signature on each platform
Flutternot available
iOSnot available
AndroidDrengr.installUrlConnectionCapture(): Boolean
Webnot available

register(on:)

Attach capture to a URLSessionConfiguration you build yourself.

register(on:) signature on each platform
Flutternot available
iOSDrengr.register(on configuration: URLSessionConfiguration)
Androidnot available
Webnot available

Experimental

Experimental APIs
PlatformAPIWhat
AndroidDrengr.experimentalComposeTapCapture(activity)Compose tap capture, plus a matching Stop call.
iOSDrengr.experimentalSwiftUITapCapture()SwiftUI tap capture.
AndroidDrengr.cronetListener(executor)Cronet request listener, returned as Any? so Cronet stays an optional dependency.

Versions

What you can resolve from each registry today, not what is on the branch.

Current published SDK versions and where the sample apps live
PlatformPackageVersionSample app
Flutterdrengr_flutter_sdk0.4.1sdk/flutter/example
Webdrengr-js0.3.0
iOSDrengr0.3.0sdk/ios/SampleApp
Androiddev.drengr:analytics-android0.3.0sdk/android/demo-shop

The sample apps are the reference integration. Every snippet in these docs is the same call shape those apps make; if the two ever disagree, trust the sample app and tell us.

Method list and signatures read from the SDK sources. Consent semantics are on Privacy controls, and the event contract is at /docs/events.json.