Handling the Embed Token
The Embed Token will be handled automatically from the Embeddable it was created from.
See the Handling the Embed Token-section:
Handling the Embed TokenWhen integrating an embeddable component, ensuring secure and continuous access to your data is critical. The embeddable requires an embed token for authentication, and because these tokens expire after a while, you need to implement a strategy to refresh them automatically. This page provides a technical walkthrough on managing the embed token with our library.
Token expired or not initialized
When the token expires it is not necessarily smart to show an error to the user, therefore when a token is expired, by default, a loading screen is shown until set. Meaning that until a token is set, the view will load. Any other relevant errors will be shown to the user.
Displaying token expiration as an error in the EmbeddableView
By default when an invalid token is present, the Embeddable will show a loading spinner. If you want an error-message instead you can add the showInvalidTokenError-property to your Embeddables settings. This is especially useful for developing.
embeddable.createView({
... other properties
settings: {
// If we want to show the error message to the user when the token is invalid rather than a loading spinner
// Default is false
showInvalidTokenError: true,
},
})