From 5 to 6
Compatibility
- Browser support: We support Safari mobile and desktop 16, Chrome 109 and Firefox 106. Browsers older than this may still be able to use our SDK, but may require additional transpile and polyfills.
- No polyfills are included since all APIs used are also supported in the versions supported.
- Custom themes require support for
color-mixCSS function. A compatibility helper is available if you are targeting older browsers.
Step by step guide
Update to use custom element
The library now exports a custom element, and StytchUIClient is deprecated in favor of StytchClient.
Instead of calling
stytch.mount(), register the custom element and call render() on the element to pass in the client and config.Update products configuration
If
config.products are specified as strings, update them to use Products instead:Update styles to presentation
The new presentation property now controls theming and styling options. This differs from the previous style property in that it configures tokens affecting many elements rather than properties on specific elements.We have provided a migration helper function. In development mode this function will also print out warnings about properties that could not be migrated.presentation.presentation.theme
Controls CSS styling. Each token corresponds to some CSS properties, so each value should be a CSS value. You can also provide an array of [lightTheme, darkTheme] which will automatically switch between the two depending on the user's OS color scheme.presentation.options
Controls non-styling options such as the logo to display.More styling changes
These changes are unlikely to cause issues.Update customized strings
If you use string customization, check if you need to update these strings:You may also wish to customize these new strings:
Update deprecated imports
The following are deprecated and should be updated.
createStytchUIClient→createStytchClientcreateStytchHeadlessClient→createStytchClientStytchUIClient→StytchClientStytchHeadlessClient→StytchClient