From 5 to 6
@stytch/vanilla-js is no longer needed for @stytch/react
and @stytch/nextjs.
See their respective upgrade guides for how how to update to the new version.
Compatibility
Step by step guide
1
Upgrade @stytch/vanilla-js
Run
npm, yarn or pnpm to install the new version.package.json
2
Update to use custom element
The library now exports a custom element, and StytchB2BUIClient is deprecated in favor of StytchB2BClient.
Instead of calling
stytch.mount(), register the custom element and call render() on the element to pass in the client and config.3
Update products configuration
4
Update styles to presentation

5
Update customized strings
6
Update deprecated imports
The following are deprecated and should be updated.
createStytchB2BUIClient→createStytchB2BClientcreateStytchB2BHeadlessClient→createStytchB2BClientStytchB2BUIClient→StytchB2BClientStytchB2BHeadlessClient→StytchB2BClient
7
Test your changes
We recommend running through every auth method used to make sure the new theme looks correct in context. You should also take note of errors or warnings in the browser console.