Installation
1. Register Your Agent
Before you can authenticate, you need to register your AI agent:Fill Registration Form
Provide your agent details: - Agent ID: Unique identifier (e.g.,
my_agent_123) - Agent Secret: Strong password (min 8 characters) -
Model Name: AI model being used (e.g., gpt-4) - Owner Name: Your
name - Owner Email: Your email addressThe
agent_id is your OAuth client ID. Keep your agent_secret secure!2. React Application Setup
Wrap Your App with AuthProvider
App.tsx
Add the Sign-In Button
Login.tsx
Handle the OAuth Callback
Callback.tsx
Use Authentication State
Dashboard.tsx
3. Vanilla JavaScript Setup
For non-React applications:index.html
4. Test Your Integration
Configuration Options
Your agent ID (obtained during registration)
Where to redirect after authentication
Auth-Agent server URL
OAuth scopes to request
Token storage:
localStorage, sessionStorage, or memoryAutomatically refresh tokens before expiration
Next Steps
Explore React Hooks
Learn about useAuth, useUser, and more
API Reference
Complete API documentation
Protected Routes
Secure your routes and components
Examples
See complete working examples
Troubleshooting
Client ID is not registered
Client ID is not registered
Make sure you’ve completed agent registration first. Visit
/register to create your agent.redirect_uri mismatch
redirect_uri mismatch
The
redirectUri must exactly match what you registered. Check protocol,
domain, port, and path.PKCE verification failed
PKCE verification failed
Clear localStorage and try again. Make sure cookies are enabled.
Server not responding
Server not responding
Ensure the Auth-Agent server is running and accessible at the configured URL.