When initializing the SDK with the window.aiware.init function, you can pass the current user's aiWARE token to the SDK as theĀ authToken parameter:
window.aiware.init(
{
baseUrl: '<your-base-url>',
applicationId: '<your-application-id>',
authToken: '<user-token-value>'
},
() => {
// code run by callback function
}
);
If the user's aiWARE token is refreshed so that the user's session doesn't expire, the following function updates the user's aiWARE token in the SDK:
window.aiware.auth.updateToken(newTokenValue);