Skip to main content
This guide shows how to enable Email Magic Links in Stytch Login, then authenticate Magic Link tokens on your backend. For broader SDK details, see the frontend SDK docs. Stytch SDK auth flow
1

Configure your project in the Stytch Dashboard

  1. Create Login and Sign-up redirect URLs on the redirect URL configuration page.
  2. In Frontend SDK, authorize your domain and enable Email magic linksEnable the LoginOrCreate Flow.
  3. From Project ID & API keys, copy your public_token.
2

Install the frontend SDKs

Install the frontend package:
3

Wrap your app with StytchProvider

4

Configure Stytch Login with Magic Links

5

Customize the UI (optional)

6

Add server-side support

Install the backend SDK:
When a user logs in for the first time, the SDK creates a Stytch User and returns a user_id. Save it in your user store.
Handle Magic Link authentication on a route that receives the token query param:
If authentication is successful, create a user session and log them into your app. To keep users logged in longer, set session_duration_minutes. See the session management guide.