Install the @stytch/vanilla-js, @stytch/react packages via npm or yarn.
npm install @stytch/vanilla-js @stytch/react --save
Initialize the SDK with the StytchHeadlessB2BClient constructor provided in the vanilla-js package.
Install the @stytch/vanilla-js, @stytch/react packages via npm or yarn.
npm install @stytch/vanilla-js @stytch/react --save
Initialize the SDK with the StytchHeadlessB2BClient constructor provided in the vanilla-js package.
Example
import { StytchB2BProvider } from '@stytch/react/b2b';
import { StytchHeadlessB2BClient } from '@stytch/vanilla-js/b2b';
const stytch = new StytchHeadlessB2BClient('PUBLIC_TOKEN');
// Wrap your App in the StytchProvider
ReactDOM.render(
<StytchB2BProvider stytch={stytch}>
<App />
</StytchB2BProvider>,
document.getElementById('root'),
);