Skip to main content
For a full walk-through of how to get up and running with a sign-up and login flow using Stytch, check out our Quickstart Guide.
1

Install Packages

Install the @stytch/vanilla-js package:
npm install @stytch/vanilla-js
2

Create the Stytch client

Initialize the Stytch client, passing in your Project’s public_token from the Project Overview of the Stytch Dashboard.
import { createStytchB2BClient } from '@stytch/vanilla-js/b2b';

const stytch = createStytchB2BClient(
  import.meta.env.STYTCH_PUBLIC_TOKEN, // or process.env.STYTCH_PUBLIC_TOKEN for non-Vite based projects
);
3

Add your login flow

You have now initialized the Stytch client, and can add the pre-built login component to get a robust, end-to-end login flow working with just a simple config.