/
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

/

About Stytch

/

Migrations

/

Migrating users dynamically

Migrating user data dynamically

If your users have passwords, Stytch recommends to use the static migration approach.

For users that do not have passwords (i.e. passwordless login), there are two strategies to migrate user data:

  1. Implement a static migration via API.
  2. Implementing a rolling migration (recommended).

Implement a rolling migration on user login

For this strategy, exporting or importing users via API is not required. You do not need to write a script or a dual write + backfill job for user import.

With a rolling migration, you'll deploy your auth integration with Stytch to production with zero users pre-migrated to Stytch. As users log in to your application via any passwordless method, your application should execute the following logic:

  1. As each user logs in, call the Stytch API and authenticate the user to create a Session.
  2. Look up the user in your internal database.
  3. If the user already exists in your internal db, append the Stytch user_id to the user internally.
  4. If the user is not found in your internal database, this is a net new sign up. Create the user in your internal database and include the Stytch user_id with the new record.

Here is an example of a rolling migration architecture:

Dynamic migration

Adding TOTP or Biometrics for MFA

For auth factors like TOTP and Biometrics, you cannot use the Create User endpoint or Migrate Password endpoint.

Instead, you will need to re-enroll users using Stytch's APIs or SDKs after they've been imported and authenticated (i.e. the Stytch User record must have a user_id and an active status). See the relevant endpoints here: TOTP Register and Biometrics Register.

Note: You cannot add additional factors onto user's accounts until their primary factor has been verified. See the Email/phone verification status section under Additional Migration Considerations for more information.

For enterprises

Contact us for more information on enterprise grade bulk import support.

What's next

Check out the additional migration considerations guide to learn how to move your app logic to Stytch and for more user import guidance.

Implement a rolling migration on user login

Adding TOTP or Biometrics for MFA

For enterprises

What's next