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 contextapiKeyβ Your Azeoo SDK API keyenvironmentβ 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/pathPrefixsafeAreaβ Optional safe area insets (top, bottom, left, right)connectorβ Optional connector configcallbackβ Called when initialization completes (nullon success,Exceptionon 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 genderheightβ User height value + unit (AzeooHeight)weightβ User weight value + unit (AzeooWeight)callbackβAzeooUserProfile?on success orException?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.