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.