Installation
Prerequisites#
- Next.js 14+ (App Router)
- React 18+
- TypeScript (recommended)
Install the Package#
Terminal
Loading...
Or with other package managers:
Terminal
Loading...
Optional Peer Dependencies#
If you plan to use the client-side features (AuthProvider, useAuth hook), you'll also need SWR:
Terminal
Loading...
If you need internationalization support:
Terminal
Loading...
Environment Setup#
Create or update your .env.local file:
Terminal
Loading...
TypeScript Configuration#
The library ships with TypeScript definitions. No additional setup needed.
The client-side AuthProvider and useAuth are generic, so instead of augmenting a
fixed type you pass your own user shape as a type parameter:
TSX
Loading...
Verify Installation#
Create a simple test file to verify the installation:
TypeScript
Loading...
Run it:
Terminal
Loading...
Next Steps#
- Quick Start - Set up your first proxy
- Configuration - Customize the behavior