Creates a new client
A short string identifying your client to the host application
The expected origin for the host app. Defaults to the current app's origin
Gets the current valid auth token for use. As the name implies, the host app may change the token at any time, so the result of this call should not be cached. Instead, call this method each time you need to make an API call. It should almost always resolve immediately. If the promise is ever rejected, that's a fatal error for auth setup, so be sure to catch errors and log and monitor them appropriately.
A promise to the token.
The time in ms to wait for a token to be provided in the rare event that one is not ready when the client starts.
Notifies the host app that the client received a 401 from the API. The token that triggered the 401 must be provided so that the client can verify that it is up-to-date before asking the host app to take a potentially destructive action like refreshing the entire app.
The token value that received a 401
Generated using TypeDoc
This is the class used to manage authentication tokens provided by the host application. Be sure to read the docs for each method, as they contain important details about the contract with the host application.