Quick Setup
Configuration
Basic Configuration
Pattern Options
URL Patterns
Usage Examples
Protect Dashboard
Plan-Based Protection
Multiple Plans
React Integration
With Router
Protected Route Component
Event Handlers
Loading States
Show Loading While Checking
Custom Loading UI
Caching
Access checks are cached to improve performance:Server-Side Rendering
For SSR frameworks, check access on the server:Debugging
Enable debug mode:- Pattern matching results
- Access check outcomes
- Redirect decisions
Best Practices
Order Patterns Specifically
Order Patterns Specifically
More specific patterns should come before general ones.
Use Consistent URLs
Use Consistent URLs
Ensure your login and upgrade URLs are consistent across patterns.
Handle Edge Cases
Handle Edge Cases
Consider what happens when users navigate directly to protected URLs.
Test Thoroughly
Test Thoroughly
Test all patterns with different user states (logged out, free, pro, etc.).