Skip to main content

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​

CredentialPurposeCreated byUsed in
SDK API KeyIdentifies your app to the Azeoo backendAzeoo teaminitialize(apiKey)
User JWTIdentifies the logged-in userYour 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​

FieldRequiredSource
tokenYesYour backend β€” see Creating the User JWT
genderYesYour user profile
heightYesMeasurements
weightYesMeasurements
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() then initialize() again
  • Flutter: typically disconnect() is enough; re-init is host-specific

Next steps​