Implementation
Usage examples
React Router v6
Next.js App Router
Advanced patterns
With redirect to original destination
With role-based access
With wallet requirement
Key concepts
- Authentication check - Verifies user is logged in
- Loading state - Shows loading while SDK initializes
- Automatic redirect - Sends unauthenticated users to login
- Preserve location - Can remember where user tried to go
- Flexible protection - Can add additional requirements (roles, wallets, etc.)
Important notes
Use
replace prop in Navigate to prevent users from going back to protected routes using the browser back button.Next steps
Authentication Flow
Build your login page
Dashboard
Create protected dashboard