If you are using Stytch UI, use StytchB2BUIClient, otherwise use StytchB2BHeadlessClient from @stytch/vanilla-js/b2b/headless for smaller bundle size.
Report incorrect code
Copy
Ask AI
// For Stytch UIimport { StytchB2BUIClient } from '@stytch/vanilla-js/b2b';// Without Stytch UIimport { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
If you are using React or Next.js, pass the StytchB2BUIClient into <StytchB2BProvider>.
Report incorrect code
Copy
Ask AI
<StytchB2BProvider stytch={stytch}> // Your app here</StytchB2BProvider>
If you are only using @stytch/vanilla-js, use the mount functions on the client. elementId is a selector matching an element on the page to mount Stytch UI to. Make sure this element is included in your HTML file before the script tag containing your Stytch configuration.
The style object allows you to customize the look of the SDK. You can specify
some of them or none at all. We’ll use our defaults for the ones you don’t
specify.