Provider Setup
TheDeploymentProvider component wraps your application and provides authentication context to all child components.
Basic Setup
Using Route Context
Integrate with TanStack Router’s route context:Provider Props
| Prop | Type | Required | Description |
|---|---|---|---|
publicKey | string | Yes | Your Wacht deployment public key |
uiOverwrites | DeploymentUISettings | No | Custom UI settings |
UI Customization
Customize the appearance of Wacht components:DeploymentUISettings
Environment Configuration
Required Environment Variables
Optional Environment Variables
Routing Configuration
Auth Routes
Create dedicated routes for authentication:SSO Callback Route
Required for OAuth authentication:Magic Link Verification Route
For magic link authentication:Route Protection
Using beforeLoad
Protect routes at the router level:Using Conditional Components
Using Route Loaders
Navigation Configuration
Custom Redirect URLs
Control where users are redirected after authentication:Post-Authentication Redirects
Error Handling
Error Routes
Create error pages for authentication errors:Error Callbacks
Components accept error callbacks:Multi-Tenant Setup
Organization Context
Enable organization-aware routing:Workspace Context
Enable workspace-aware routing:Production Considerations
Deployment Checklist
- Set
VITE_WACHT_PUBLIC_KEYenvironment variable - Configure allowed redirect URLs in Wacht dashboard
- Set up OAuth providers if using social sign-in
- Configure email delivery for email verification
- Test SSO callback route locally
- Enable HTTPS in production
Performance Optimization
Related
- Installation - Installation guide
- Quick Start - Quick start guide
- Components Reference - Component reference
