/
Contact usSee pricingStart building
Node
​

    About Stytch

    Introduction
    Integration Approaches
      Full-stack overview
      Frontend (pre-built UI)
      Frontend (headless)
      Backend
    Migrations
      Migration overview
      Migrating users statically
      Migrating users dynamically
      Additional migration considerations
      Zero-downtime deployment
      Defining external IDs for users
      Exporting from Stytch
    Custom Domains
      Overview

    Authentication

    DFP Protected Auth
      Overview
      Setting up DFP Protected Auth
      Handling challenges
    Magic Links
    • Email Magic Links

      • Getting started with the API
        Getting started with the SDK
        Replacing your password reset flow
        Building an invite user flow
        Add magic links to an existing auth flow
        Adding PKCE to a Magic Link flow
        Magic Link redirect routing
    • Embeddable Magic Links

      • Getting started with the API
    MFA
      Overview
      Backend integration
      Frontend integration
    Mobile Biometrics
      Overview
    M2M Authentication
      Authenticate an M2M Client
      Rotate client secrets
      Import M2M Clients from Auth0
    OAuth
    • Identity providers

      • Overview
        Provider setup
      Getting started with the API (Google)
      Add Google One Tap via the SDK
      Email address behavior
      Adding PKCE to an OAuth flow
    Connected AppsBeta
      Setting up Connected Apps
      About Remote MCP Servers
    • Resources

      • Integrate with AI agents
        Integrate with MCP servers
        Integrate with CLI Apps
    Passcodes
      Getting started with the API
      Getting started with the SDK
    • Toll fraud

      • What is SMS toll fraud?
        How you can prevent toll fraud
      Unsupported countries
    Passkeys & WebAuthn
    • Passkeys

      • Passkeys overview
        Set up Passkeys with the frontend SDK
    • WebAuthn

      • Getting started with the API
        Getting started with the SDK
    Passwords
      Getting started with the API
      Getting started with the SDK
      Password strength policy
    • Email verification

      • Overview
        Email verification before password creation
        Email verification after password creation
    Sessions
      How to use sessions
      Backend integrations
      Frontend integrations
      Custom claims
      Custom claim templates
      Session tokens vs JWTs
      How to use Stytch JWTs
    TOTP
      Getting started with the API
      Getting started with the SDK
    Web3
      Getting started with the API
      Getting started with the SDK

    Authorization

    Implement RBAC with metadata

    3rd Party Integrations

    Planetscale
    Supabase
    Feathery
    Unit

    Testing

    E2E testing
    Sandbox values
Get support on SlackVisit our developer forum

Contact us

Consumer Authentication

/

Guides

/

Authentication

/

Passwords

/

Getting started with the SDK

Setting up passwords using the SDK

Use the selector below to select the SDK you are using.

Choose an SDK

React
​

Step 1: Configure your project in the Stytch dashboard

Before adding passwords to your application you will need to make the following project configurations within the Stytch dashboard:

  1. Create a Login and Reset Password redirect URL on the redirect URL configuration page. These will used during the password reset flow.
  2. Within SDK Configuration, authorize the domain(s) (eg. http://localhost:3000) the SDK will run on. Under Auth methods enable the Passwords toggle, and the Email magic links > Enable the LoginOrCreate Flow toggle.
  3. Finally, under API keys, save your project's public_token for later.

Step 2: Add Stytch to your project

2.1 Add packages

2.2 Initialize Stytch

At the top level of your application you will need to initialize the Stytch client using the public_token saved in the previous step.

Step 3: Configure sign up and login

Next, create a component that will render on your sign up, and login page. Within this component you will configure, and render the Stytch UI. The Stytch UI accepts a config object as an argument; learn more about this object here. You will need the Login and Password Reset redirect URLs you configured in step one.

Step 4: Configure password reset

A password reset flow has two parts. First, an email is sent to the user which includes a link back to your application; this link contains a unique token which is used for validation. Once the link is clicked, which ensures the user has control of the email address associated with the account, they are then able to set a new password.

Triggering a password reset is handled by the Stytch UI which was configured in the previous step. Now, we will build a separate component which handles the second step of the password reset. Create a component which will appear on the page that your Password Reset redirect url points to. On this page we will configure and render the password reset Stytch UI.

Configure magic links

The password reset email sent by Stytch includes an additional button which allows the user to login directly. Our data indicates a large portion of password resets are initiated with the intention to login; by providing a Login without a password option during the reset flow you can increase your number of active users, and their engagement with your application.

Image

The "Login without a password" button is powered by a Magic link. On the page your Login redirect URL points to you will need to capture the token value from the URL query parameters, and authenticate it.

Step 5: Tie it all together

You have now built all the pieces needed for a password sign up and log in flow that handles both password resets, and magic link passwordless login. When a user logs in successfully the SDK will automatically start and manage a session on your behalf. You can learn more about how to use sessions here.

Have any feedback after integrating? Get in touch with us and tell us what you think in our forum, support@stytch.com, or in our Slack community.

Step 1: Configure your project in the Stytch dashboard

Step 2: Add Stytch to your project

2.1 Add packages

2.2 Initialize Stytch

Step 3: Configure sign up and login

Step 4: Configure password reset

Configure magic links

Step 5: Tie it all together