From 21 to 22
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
Upgrade packages
Upgrade Run
@stytch/nextjs and remove @stytch/vanilla-js:
vanilla-js is now included in @stytch/nextjs and no longer a peer dependency.package.json
npm, yarn or pnpm to install the new version.Update imports
Copy all imports from
@stytch/vanilla-js to @stytch/nextjs.
The b2b/ui and b2b/headless imports have also been merged into the main b2b import.Update products configuration
If
config.products are specified as strings, update them to use B2BProducts instead:Update styles to presentation

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.
createStytchB2BUIClient→createStytchB2BClientcreateStytchB2BHeadlessClient→createStytchB2BClient