Skip to main content

SDK entry point (init and connect)

The Azeoo SDK is used through AzeooSDK: you call init once, then connect when the user is authenticated.

init​

fun init(
context: Context,
apiKey: String,
config: AzeooConfig? = null,
theme: AzeooThemeConfig? = null,
deepLinks: AzeooDeepLinkConfig? = null,
safeArea: AzeooSafeAreaConfig? = null,
enableMultipleInstances: Boolean = false
): AzeooSDK

Initializes the SDK with your API key and optional configuration. Call this once (e.g. in Application.onCreate()).

Parameters:

  • context β€” Application context
  • apiKey β€” Your Azeoo SDK API key
  • config β€” Optional: locale, analyticsEnabled, offlineEnabled, etc.
  • theme β€” Optional theme colors (light/dark primary, secondary, etc.)
  • deepLinks β€” Optional deep link scheme/host/pathPrefix
  • safeArea β€” Optional safe area insets (top, bottom, left, right)
  • enableMultipleInstances β€” Set to true if you need multiple Flutter engines (e.g. multiple modules visible at once)

Returns: The AzeooSDK instance. You can also use AzeooSDK.shared after init.

shared​

val shared: AzeooSDK

The singleton SDK instance. Throws if init has not been called.

connect​

fun connect(
userId: String,
token: String,
callback: (Result<AzeooUserProfile>) -> Unit
)

Attaches an authenticated user. Must be called before using modules or the user API.

Parameters:

  • userId β€” The authenticated user's ID
  • token β€” The user's auth token (e.g. JWT)
  • callback β€” Result with AzeooUserProfile on success or error on failure

onReady​

fun onReady(callback: (Result<Unit>) -> Unit)

Registers a callback that is invoked when Flutter-side initialization is complete. If already ready, the callback runs immediately. Use this before showing SDK UI (e.g. before adding the nutrition fragment).

isReady​

val isReady: Boolean

Whether the SDK is fully initialized (Flutter side ready and no initialization error).

disconnect​

fun disconnect(callback: (Result<Unit>) -> Unit)

Disconnects the current user and clears user-specific state. The SDK remains initialized; you can call connect again with another user.

dispose​

fun dispose()

Releases SDK resources. Call when the app is shutting down or you no longer need the SDK.