configure method

Future<void> configure({
  1. required String appId,
  2. String? baseUrl,
  3. String? realtimeBaseUrl,
})

Prepares the SDK. Call once at startup, before using any product. Idempotent.

The device identity and network client are ready immediately, then the session opens in the background: the Future resolves without waiting for the network. Blocking app startup on a round trip would be paid by every user, offline ones included.

baseUrl is for development, to point at a local API (http://localhost:3000 on the iOS simulator, http://10.0.2.2:3000 on the Android emulator). Leave it null in production.

Implementation

Future<void> configure({
  required String appId,
  String? baseUrl,
  String? realtimeBaseUrl,
}) {
  return AppwinCorePlatform.instance.configure(
    appId: appId,
    baseUrl: baseUrl,
    realtimeBaseUrl: realtimeBaseUrl,
  );
}