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 contextapiKey— Your Azeoo SDK API keyconfig— Optional: locale, analyticsEnabled, offlineEnabled, etc.theme— Optional theme colors (light/dark primary, secondary, etc.)deepLinks— Optional deep link scheme/host/pathPrefixsafeArea— 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 IDtoken— The user's auth token (e.g. JWT)callback— Result withAzeooUserProfileon 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.