Skip to main content
Version: 1.1.0

πŸ”‘ SDK entry point (initialize and connect)

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

Import from com.azeoo.sdk.core.*.

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
)

Starts the Flutter engine, waits for Dart readiness, validates the API key with the server, then invokes callback.

Parameters:

  • context β€” Application context
  • apiKey β€” Your Azeoo SDK API key
  • environment β€” "production" or "staging" (optional)
  • config β€” Optional: locale, analyticsEnabled, offlineEnabled, connectionTimeoutSeconds
  • 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 β€” see Connectors
  • callback β€” null on success, Exception on failure
Use initialize, not init

The legacy init method no longer exists. Always use initialize and wait for the callback before connectUser.

shared​

val shared: AzeooSDK

The singleton SDK instance. Throws if initialize has not completed successfully.

connectUser​

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

Authenticates the user. Must be called before using modules or the user API.

Parameters:

  • token β€” User JWT from your backend
  • gender β€” User gender string
  • height β€” AzeooHeight value object
  • weight β€” AzeooWeight value object
  • callback β€” Profile on success (profile.id is the Azeoo user id), error on failure
Do not pass userId

The user id is inside the JWT and returned in profile.id. Do not pass a separate userId parameter.

onReady​

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

Registers a callback invoked when initialization completes. If already initialized, the callback runs immediately.

isReady / isInitialized​

val isReady: Boolean
val isInitialized: Boolean
val isUserConnected: Boolean

isReady β€” Flutter side ready and no initialization error.

setClubId​

fun setClubId(clubId: Long, callback: (error: Exception?) -> Unit)

Switches the active club for an azeoo connector. Re-exchanges SDK tokens and preserves the user session.

disconnect​

fun disconnect(callback: (error: Exception?) -> Unit)

Disconnects the current user. The SDK remains initialized; you can call connectUser again.

dispose​

fun dispose()

Releases SDK resources. Call when shutting down or when you need a full reset. Call initialize again to restart.

listener​

var listener: AzeooSDKListener?

Optional listener for Flutter β†’ native events. See Events.