Skip to main content
Use Stytch One-Time Passcodes (OTP) with the pre-built login UI. This guide uses the Next.js SDK, but the same configuration applies to other frontend SDKs.
1

Configure your Project in the Stytch Dashboard

  1. Navigate to Frontend SDK and click Enable SDK.
  2. In Project ID & API keys, copy your public_token.
Note: Stytch has Test and Live environments. Projects use Test by default. To call SMS OTP endpoints in Live, configure a payment method in Workspace Settings > Billing.
2

Add Stytch to your project

Install @stytch/nextjs:
Or with Yarn:
Initialize the Stytch client with your public_token:
layout.tsx
3

Configure OTP for signup and login

Create a component for your signup/login page and pass the OTP config. The Stytch UI accepts a config object; learn more here.
4

Tie it all together

You now have an OTP signup and login flow with the pre-built UI config. The SDK handles the code authentication and manages the session automatically. Learn more about sessions here.Have feedback after integrating? Reach out via support@stytch.com or in our Slack community.