Overview
Conductor’s UnifiedRouter provides a powerful, secure-by-default routing system with integrated authentication, rate limiting, and type-specific defaults. Key Features:- 🔒 Secure by Default - All routes require explicit auth configuration
- 🎯 Type-Specific Defaults - Different defaults for pages, APIs, webhooks, forms, docs
- 📍 Path-Based Rules - Centralized routing configuration in
conductor.config.ts - 🚀 Default Path Resolution - Auto-resolve routes from directory structure
- ⚡ Priority-Based - Control route matching order
- 🛡️ Multi-Method Auth - Bearer, API keys, cookies, Unkey, custom validators
- 🔢 Rate Limiting - Per-user, per-IP, or per-API-key
- 👮 RBAC - Role and permission-based access control
Quick Start
Simplest Route
Usedefault to auto-resolve path from file location:
Public Route
Authenticated Route
Role-Based Route
Architecture
Resolution Priority
Routes are resolved in this order:- Member Config - Highest priority
- Path Rules - From
conductor.config.ts - Type Defaults - Based on member type (page, api, docs, etc.)
- Global Defaults - Fallback configuration
Route Matching Priority
Routes are matched in this order:- Priority Number - Lower numbers match first (e.g., 10 before 50)
- Static vs Dynamic - Static routes before dynamic (
:param) - Path Length - Longer paths before shorter
- Registration Order - First registered wins (if all else equal)
Default Path Resolution
Theroute: default option automatically resolves paths from your directory structure.
How It Works
Pages:Examples
Simplest form:Type-Specific Defaults
Configure default auth for each member type inconductor.config.ts:
Path-Based Rules
Override defaults for specific paths:Authentication Methods
Bearer Tokens (JWT)
API Keys
Cookie Sessions
Unkey Integration
Custom Validators
stripe-signature- Stripe webhook signaturesgithub-signature- GitHub webhook signaturestwilio-signature- Twilio webhook signatures
Rate Limiting
Per-IP (Public Routes)
Per-User (Authenticated)
Per-API-Key
Failure Handling
Redirect to Login
Show Error Page
Return JSON Error
Stealth Mode (404)
Best Practices
1. Use Type Defaults
Configure sensible defaults inconductor.config.ts:
2. Use Path Rules for Common Patterns
3. Use Default Paths
4. Add Rate Limiting
5. Implement RBAC
Related
- Authentication - Detailed auth documentation
- Configuration - Full configuration reference
- Docs Member - API documentation with routing
- Page Member - Web pages with routing

