Stytch React Example banner
stytchauth stytchauth

Stytch React Example

Communication community

Description

Example B2C React application featuring Email Magic Link and Google OAuth authentication powered by Stytch

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Stytch B2C React example application

Overview

This example application demonstrates how one may use Stytch within a React application. The project now uses [Vite](https://vitejs.dev/) for development and building the application.

This project uses Stytch's [React SDK](https://stytch.com/docs/sdks/javascript-sdk) which provides pre-built UI components, useful React hooks, and headless methods to securely interact with Stytch.

This application features Email Magic Links and OAuth. You can use this application's source code as a learning resource, or use it as a jumping off point for your own project. We are excited to see what you build with Stytch!

This app also implements an authorization page for Stytch Connected Apps, which hosts the IdentityProvider component (related guide in Stytch docs is [here](https://stytch.com/docs/guides/connected-apps/cli-app)). If you're just here to learn about Stytch with React, ignore `components/Authorize.js`.

New! Set up with a Coding Agent

Install the [Stytch MCP Server](https://mcp.stytch.dev) and instruct coding agents to follow the steps in `Agents.md`.

Set up

Follow the steps below to get this application fully functional and running using your own Stytch credentials.

In the Stytch Dashboard

  1. Create a [Stytch](https://stytch.com/) account. Once your account is set up a Project called "My first project" will be automatically created for you.

  2. Within your new Project, navigate to [SDK configuration](https://stytch.com/dashboard/sdk-configuration), and make the following changes:

    • Click **Enable SDK**.

    • Under **Authorized environments** add the domain `http://localhost:3000`.

      Authorized environments

3