Skip to main content
Every public export of the appstack_plugin pub.dev package. For installation and integration guidance, see the Flutter SDK guide. Current stable release: 2.10.0, published 16 September 2026. See the changelog for everything that changed.

AppstackPlugin

All members are static. Every method returns a Future, except getAttributionParamsWithCallback(), which returns a Stream.

configure()

Starts the SDK. Call once, as early in app startup as possible. A repeat call is a no-op, including its customerUserId, so use setCustomerUserId() to set the ID later. Throws ArgumentError when apiKey is empty or logLevel falls outside 0 to 3.
String
required
Your app’s Appstack API key, from the dashboard under app settings.
int
default:"1"
Console verbosity, descending: 0 DEBUG, 1 INFO, 2 WARN, 3 ERROR. iOS has no dedicated WARN tier, so 2 behaves like 3 there.
String?
default:"null"
Your identifier for the signed-in user, when known at startup.
Both are still accepted and have no effect. Each logs a warning when used, and will be removed in a future release.
bool
The native debug overlay was removed from the Appstack SDKs. Use logLevel: 0 for verbose logging instead.
String?
The custom endpoint override was removed from the public API. The dev proxy is now applied natively from a repo-only host-app key.

setCustomerUserId()

Sets your identifier for the signed-in user, after configure(). Callable at any time; last write wins.
String?
required
Your identifier for the signed-in user. Set it as soon as it is known, and at least one event has to follow for it to take effect.

sendEvent()

Sends a standard or custom event.
EventType
required
The event to send. See EventType.
String?
default:"null"
The event name, for EventType.custom.
Map<String, dynamic>?
default:"null"
Event properties. For revenue events send revenue and currency.
Future<bool>
Resolves true when the event was sent successfully.
Parameter values must be strings, finite numbers, booleans, lists, or nested string-keyed maps. A DateTime, Uri, Set or arbitrary object cannot cross the platform channel and throws ArgumentError before reaching the native SDK. Convert those yourself, for example with date.toIso8601String().A null value is omitted from the payload and the event still sends; nulls nested inside a list are preserved. A value the native SDK cannot serialize, such as double.nan, double.infinity, or a typed-data list like Uint8List, has its key dropped individually and the event still sends with the remaining parameters.
Custom parameter values may be encrypted on the device before they are sent, so avoid relying on them being readable in raw payload inspection. This is driven entirely by remote config, with nothing to set here, and keys the backend needs in the clear (currency, revenue, campaign fields) are excluded. Revenue reporting is unaffected.

getAppstackId()

Returns the stable local Appstack identity for this install.
Future<String?>
The install’s Appstack ID, or null when not available.

isSdkDisabled()

Whether the SDK is disabled. Call it after configure() to verify that configuration succeeded.
Future<bool>
true when the SDK is disabled, for example because the API key is invalid.

getAttributionParams()

A request-response call over the method channel. On Android it runs synchronously on the platform thread, so prefer getAttributionParamsWithCallback() when attribution retrieval time may vary.
Future<Map<String, dynamic>?>
Attribution parameters, or null when none are available.
On iOS the map always contains appstack_match_status, describing the attribution outcome: matched, matched_no_params, organic, skipped, failed or not_configured. Only failed is worth retrying. Android does not send that key yet, so keep treating an empty map as “nothing yet”.

getAttributionParamsWithCallback()

A push-style stream backed by a native background thread, freeing the platform thread rather than blocking it until the SDK responds. The stream emits exactly one value and then closes.
Stream<Map<String, dynamic>?>
A single-value stream of attribution parameters.
Parses an Appstack standard Universal Link or App Link delivered by your app’s link handler. Safe to call before configure(). Throws ArgumentError when allowedHosts contains a blank hostname.
Uri
required
The tapped link.
Set<String>?
default:"null"
Hosts to accept. A link on any other host returns null. Omit to accept any host.
Future<AppstackLinkResult?>
The parsed link, or null for unsupported links.

enableAppleAdsAttribution()

Starts Apple Search Ads attribution. iOS 14.3+ only, and a no-op on Android.
Future<bool>
Resolves true when attribution was enabled successfully.

deleteUserData()

Permanently deletes this install’s Appstack data, for GDPR and privacy requests. Available on both iOS and Android.

Types

AppstackLinkResult

The link’s single path segment. Optional in both native SDKs, so it is nullable here rather than collapsed to an empty string.
Map<String, String>
Query parameters parsed off the tapped URL.
Uri
The URL that was handled.

EventType

Standard attribution events. Cases are lowerCamelCase in Dart, and the value sent over the wire is the SNAKE_CASE form: EventType.addToCart becomes "ADD_TO_CART". Where two names are synonymous, both are provided for compatibility with existing integrations.
install is tracked by the SDK itself. Passing it to sendEvent() has no effect: both native SDKs discard a manual install event so it cannot inflate install counts.

EventTypeExtension

String
The SNAKE_CASE event name as sent over the wire.