initialize static method

Future<void> initialize(
  1. DigiaConfig config
)

Initializes the Digia SDK with the provided configuration.

Call this once at application startup — typically in main() before runApp() — and await the result before any other Digia call.

Internally this starts the real SDK services: SharedPreferences, fetches engage campaigns, and wires the overlay controller.

The SDK enters degraded mode if register is not subsequently called: all calls are accepted and logged, but no experiences are displayed.

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Digia.initialize(DigiaConfig(apiKey: 'prod_xxxx'));
  runApp(const MyApp());
}

Implementation

static Future<void> initialize(DigiaConfig config) {
  return DigiaInstance.instance.initialize(config);
}