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 | Flutter | iOS | Android | Web |
|---|---|---|---|---|
| start | yes | yes | yes | yes |
| identify | yes | yes | yes | yes |
| setExperiment | yes | yes | yes | yes |
| setEnabled | yes | yes | yes | yes |
| optOut | yes | yes | yes | yes |
| optIn | yes | yes | yes | yes |
| flush | yes | yes | yes | yes |
| stop | yes | — | — | yes |
| clear | yes | — | — | — |
| trackNavigation | — | — | yes | — |
| wrapClient | yes | — | — | — |
| installInIsolate | yes | — | — | — |
| installUrlConnectionCapture | — | — | yes | — |
| register(on:) | — | yes | — | — |
Core methods
Present on all four SDKs, with the same meaning everywhere.
start
Install capture. Call once, as early as possible.
| Flutter | Drengr.start({publishableKey, ingestUrl, appPackage, enabled, behavior, maxBodyBytes, …}) |
|---|---|
| iOS | Drengr.start(publishableKey:ingestURL:appPackage:startEnabled:behavior:maxBodyBytes:…) |
| Android | Drengr.start(context, publishableKey, ingestUrl, appPackage, startEnabled, maxBodyBytes, …): DrengrInterceptor |
| Web | Drengr.start({ publishableKey, ingestUrl, appPackage, enabled, … }) |
identify
Attach your own stable, non-PII user id. Emits one identify event.
| Flutter | Drengr.identify(externalId, traits) |
|---|---|
| iOS | Drengr.identify(_ externalId: String, traits: [String: Any] = [:]) |
| Android | Drengr.identify(externalId: String, traits: Map<String, Any?> = emptyMap()) |
| Web | Drengr.identify(externalId, traits) |
setExperiment
Record the active A/B variant carried on every later event.
| Flutter | Drengr.setExperiment(key, variant) |
|---|---|
| iOS | Drengr.setExperiment(_ key: String, variant: String?) |
| Android | Drengr.setExperiment(key: String, variant: String?) |
| Web | Drengr.setExperiment(key, variant) |
setEnabled
Pause or resume capture in memory. Not persisted.
| Flutter | Drengr.setEnabled(bool) |
|---|---|
| iOS | Drengr.setEnabled(_ value: Bool) |
| Android | Drengr.setEnabled(value: Boolean) |
| Web | Drengr.setEnabled(v: boolean) |
optOut
Persistently opt this install out. Survives restarts and outranks start().
| Flutter | Drengr.optOut() |
|---|---|
| iOS | Drengr.optOut() |
| Android | Drengr.optOut() |
| Web | Drengr.optOut() |
optIn
Clear a previous opt-out and resume.
| Flutter | Drengr.optIn() |
|---|---|
| iOS | Drengr.optIn() |
| Android | Drengr.optIn() |
| Web | Drengr.optIn() |
flush
Send anything queued now instead of waiting for the next batch.
| Flutter | Drengr.flush() |
|---|---|
| iOS | Drengr.flush(completion: (() -> Void)? = nil) |
| Android | Drengr.flush(onComplete: Runnable? = null) |
| Web | Drengr.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.
| Flutter | Drengr.stop() |
|---|---|
| iOS | not available |
| Android | not available |
| Web | Drengr.stop() |
clear
Drop the buffered in-memory event ring, for example on logout.
| Flutter | Drengr.clear() |
|---|---|
| iOS | not available |
| Android | not available |
| Web | not available |
trackNavigation
Attach to a Jetpack NavController so Compose destinations get real screen names.
| Flutter | not available |
|---|---|
| iOS | not available |
| Android | Drengr.trackNavigation(navController: Any): Boolean |
| Web | not available |
wrapClient
Wrap an HttpClient explicitly, for code that builds its own.
| Flutter | Drengr.wrapClient(client) |
|---|---|
| iOS | not available |
| Android | not available |
| Web | not available |
installInIsolate
Install inside a spawned isolate, which does not inherit HttpOverrides.
| Flutter | Drengr.installInIsolate({…}) |
|---|---|
| iOS | not available |
| Android | not available |
| Web | not available |
installUrlConnectionCapture
Capture HttpsURLConnection traffic in addition to OkHttp.
| Flutter | not available |
|---|---|
| iOS | not available |
| Android | Drengr.installUrlConnectionCapture(): Boolean |
| Web | not available |
register(on:)
Attach capture to a URLSessionConfiguration you build yourself.
| Flutter | not available |
|---|---|
| iOS | Drengr.register(on configuration: URLSessionConfiguration) |
| Android | not available |
| Web | not available |
Experimental
| Platform | API | What |
|---|---|---|
| Android | Drengr.experimentalComposeTapCapture(activity) | Compose tap capture, plus a matching Stop call. |
| iOS | Drengr.experimentalSwiftUITapCapture() | SwiftUI tap capture. |
| Android | Drengr.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.
| Platform | Package | Version | Sample app |
|---|---|---|---|
| Flutter | drengr_flutter_sdk | 0.4.1 | sdk/flutter/example |
| Web | drengr-js | 0.3.0 | — |
| iOS | Drengr | 0.3.0 | sdk/ios/SampleApp |
| Android | dev.drengr:analytics-android | 0.3.0 | sdk/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.