Authentication
The SDK does not replace your login screen. Your app authenticates users; the SDK only needs a User JWT at connect time.
Two credentials, two purposesβ
| Credential | Purpose | Created by | Used in |
|---|---|---|---|
| SDK API Key | Identifies your app to the Azeoo backend | Azeoo team | initialize(apiKey) |
| User JWT | Identifies the logged-in user | Your backend (signed with SDK Secret Key) | connect(token, ...) |
Full guide
For the JWT payload spec, signing instructions, and backend code examples, see Creating the User JWT.
Flowβ
What you pass at connectβ
| Field | Required | Source |
|---|---|---|
token | Yes | Your backend β see Creating the User JWT |
gender | Yes | Your user profile |
height | Yes | Measurements |
weight | Yes | Measurements |
Do not pass userId
The Azeoo user id is returned in the connect response / AzeooSDK.userId (Flutter). Do not send your own id as a separate connect parameter. The user id goes inside the JWT payload.
Where the JWT comes fromβ
Your backend creates and signs it. See Creating the User JWT for the payload spec, HS256 signing instructions, and code examples in Node.js, Python, and PHP.
Token refreshβ
- The SDK stores tokens needed for API calls after connect.
- If your JWT expires, obtain a new token from your backend and call connect again (or disconnect then connect).
- Configure refresh in your app before handing a fresh JWT to the SDK.
Logoutβ
// Flutter
await AzeooSDK.disconnect();
// Android
AzeooSDK.shared.disconnect { }
// iOS
AzeooSDK.shared.disconnect { }
After disconnect, nutrition/training UI must not be shown until you connect again.
Full app reset (native)β
If you need to tear down the Flutter engine (e.g. switch API keys):
- Android / iOS:
dispose()theninitialize()again - Flutter: typically
disconnect()is enough; re-init is host-specific
Next stepsβ
- Creating the User JWT β payload, signing, backend code
- Measurements
- Glossary
- Integration checklist