Skip to main content

SDK entry point (initialize and connectUser)

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

initialize​

fun initialize(
context: Context,
apiKey: String,
environment: String = "production",
config: AzeooConfig? = null,
theme: AzeooThemeConfig? = null,
deepLinks: AzeooDeepLinkConfig? = null,
safeArea: AzeooSafeAreaConfig? = null,
connector: AzeooConnectorConfig? = null,
callback: (error: Exception?) -> Unit
)

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
  • environment β€” Environment string ("production" by default)
  • 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)
  • connector β€” Optional connector config
  • callback β€” Called when initialization completes (null on success, Exception on failure)

Returns: Unit. Use AzeooSDK.shared after successful initialization.

shared​

val shared: AzeooSDK

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

connectUser​

fun connectUser(
token: String,
gender: String,
height: AzeooHeight,
weight: AzeooWeight,
callback: (user: AzeooUserProfile?, error: Exception?) -> Unit
)

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

Parameters:

  • token β€” The user's auth token (e.g. JWT)
  • gender β€” User gender
  • height β€” User height value + unit (AzeooHeight)
  • weight β€” User weight value + unit (AzeooWeight)
  • callback β€” AzeooUserProfile? on success or Exception? 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: (error: Exception?) -> Unit)

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

dispose​

fun dispose()

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