This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. See Agents.md for additional content.
npm install- Install dependenciesnpm startornpm run dev- Start both frontend (port 3000) and backend (port 3001) concurrentlynpm run build- Build the application for production using Vitenpm run server- Alternative command that also starts both frontend and backend
This is a Stytch authentication example application built with React + TypeScript + Vite, demonstrating Email Magic Links and OAuth integration.
- Frontend: React application using Vite dev server on port 3000
- Backend: Express.js server on port 3001 with authentication middleware
- Authentication: Stytch SDK for React with pre-built UI components
src/App.tsx- Main router with conditional rendering based on user statesrc/components/Login.tsx- Handles authentication flowsrc/components/Profile.tsx- User profile display for authenticated userssrc/components/Authorize.tsx- Connected Apps authorization componentsrc/components/TokenAuthenticator.tsx- Token-based authentication logicserver/server.ts- Express API server with Stytch token validationserver/middleware/authorizeToken.ts- Authentication middleware
- Frontend uses
VITE_STYTCH_PUBLIC_TOKENfor Stytch configuration - Backend uses standard environment variables for server configuration
- Copy
.env.templateto.env.localand configure with your Stytch credentials
- SDK must be enabled in Stytch Dashboard
- Authorized environment:
http://localhost:3000 - Redirect URLs:
http://localhost:3000/authenticatefor LOGIN and SIGNUP
Follow instructions in Agents.md for automated setup using the Stytch MCP Server.
If the MCP server is not installed, ask the user to install it with:
claude mcp add --transport http stytch https://mcp.stytch.dev/mcp