Authentication
Learn about authentication in the Azeoo SDK. These concepts apply to all platforms. The examples below use Flutter (Dart); for Android, iOS, and React Native, see your platform's Configuration and Client API (Android · iOS · Flutter · React Native).
Authentication flow
- Initialize the SDK with your API key and options (no user yet).
- Connect with the authenticated user's
tokenplus required profile fields (gender,height,weight). - The SDK stores and uses the token for API calls; refresh is handled internally where supported.
- Disconnect when the user logs out to clear the session.
Connect (provide token)
Pass the user's token and required profile fields when you call connect after initialize:
// Flutter
await AzeooSDK.connect(
token: "your-user-token",
gender: "male",
height: Height(170),
weight: Weight(70),
);
On Android/iOS/React Native, use the equivalent connect/connectUser(token, gender, height, weight) API on the SDK instance.
Token management
The SDK handles token storage and usage for API requests. Configure any token refresh or validation in your app before calling connect with a valid token.
Disconnect (logout)
// Flutter
await AzeooSDK.disconnect();
This clears the current user and session. The SDK remains initialized; you can call connect again with another user.