- Sign up at descope.com and create a project
- Copy your Project ID from the Console
- Set it in your
.env.local:VITE_DESCOPE_PROJECT_ID=P...
- Make sure a
sign-up-or-inflow exists in the Console (it ships by default) - Add
http://localhost:3000to your project's approved domains / redirect URLs - Visit the demo route at
/demo/descopeoncenpm run devis running
<AuthProvider>at the app root (src/integrations/descope/provider.tsx) supplies auth context to the whole tree- Header user menu (
src/integrations/descope/header-user.tsx) renders the signed-in avatar + "Sign out" button (hidden when signed out) /demo/descoperenders the Descope<Descope flowId="sign-up-or-in" />flow and a signed-in greeting
Use the useSession hook to gate content:
import { useSession } from '@descope/react-sdk'
function ProtectedPage() {
const { isAuthenticated, isSessionLoading } = useSession()
if (isSessionLoading) return <p>Loading…</p>
if (!isAuthenticated) return <RedirectToSignIn />
return <YourPageContent />
}For server-side checks (route loaders, server functions), validate the session
token with the @descope/node-sdk and
validateSession().
- Use a dedicated production project and its Project ID
- Configure your production domain under Project Settings → Domains
- Customize your flows (branding, connectors, MFA) in the Flows section of the Console
- Enable the social / SSO connectors you need under Authentication Methods