Flutter SDK

Flutter SDK for Digia Engage. Renders CEP nudges (bottom sheets, dialogs) and inline content (banners, cards) designed in Digia Studio, triggered by your CEP tool.

Package: digia_engagearrow-up-right Version: 1.7.0 Platforms: Android, iOS Dart SDK: >=3.3.0 <4.0.0 License: BSL 1.1 (converts to Apache 2.0 on August 5, 2029)


Installation

flutter pub add digia_engage

Or manually in pubspec.yaml:

dependencies:
  digia_engage: ^1.7.0

Then run flutter pub get.


Get Your API Key

  1. Open your project.

  2. Go to SettingsApp Settings.

  3. Copy your API Key.

⚠️ Never commit your API key to public repositories. Use environment variables or secure storage.


Initialization

Initialize Digia once at app startup, before runApp. This is the only initialization call required.

DigiaConfig Parameters

Parameter
Type
Default
Description

apiKey

String

required

API key from the Digia dashboard.

environment

DigiaEnvironment

.production

.production or .sandbox.

logLevel

DigiaLogLevel

.error

.none, .error, or .verbose.

flavor

Flavor?

Flavor.debug()

Config loading strategy.

networkConfiguration

NetworkConfiguration?

defaults

Timeouts and HTTP headers.


Set Up DigiaHost and DigiaNavigatorObserver

After initialization, wire DigiaHost and DigiaNavigatorObserver into your MaterialApp.

  • DigiaHost — listens for incoming campaign payloads and renders overlay experiences (bottom sheets, dialogs) above all app content.

  • DigiaNavigatorObserver — forwards route changes to the registered CEP plugin for screen-based trigger rules.

Because DigiaHost sits above the app's Navigator in the widget tree, pass the same GlobalKey<NavigatorState> to both MaterialApp.navigatorKey and DigiaHost.navigatorKey:

Place DigiaHost only once, in MaterialApp.builder. Placing it multiple times or below the navigation root produces undefined behaviour — the SDK logs a warning.


DigiaHost — Nudges (Bottom Sheets & Dialogs)

DigiaHost handles SHOW_BOTTOM_SHEET and SHOW_DIALOG campaign payloads. No additional code is needed beyond the MaterialApp.builder setup above — campaigns are rendered automatically when triggered by the connected CEP tool.


DigiaSlot — Inline Content (Banners & Cards)

Place DigiaSlot wherever you want inline campaign content (banners, offer cards) to appear in your screen layout. The placementKey must match the placement ID configured in the Digia dashboard.

Behaviour:

  • Collapses to SizedBox.shrink when no campaign is active (or placeholder is null).

  • Fires an impression event the first time each unique payload renders.

  • Content persists across page dispose/rebuild — cleared only by server invalidation or user dismissal.


DigiaNavigatorObserver — Automatic Screen Tracking

DigiaNavigatorObserver forwards route changes to Digia.setCurrentScreen, which the registered CEP plugin uses for screen-based trigger rules. Add it to MaterialApp.navigatorObservers as shown in the setup above.

For routes without a name or when a custom screen name is needed, call Digia.setCurrentScreen directly:


Next Steps

Last updated