Supported Libraries
OAuth Init detects the following authentication libraries by scanning yourpackage.json:
| Library | Callback Pattern |
|---|---|
next-auth | /api/auth/callback/[provider] |
@auth/core | /api/auth/callback/[provider] |
better-auth | /api/auth/callback/[provider] |
lucia | /auth/callback |
arctic | /auth/callback/[provider] |
iron-session | /api/auth/callback |
How Detection Works
OAuth Init reads your project’spackage.json and checks both dependencies and devDependencies for any of the supported authentication libraries.
Callback URL Generation
Once a library is detected, OAuth Init generates the appropriate callback URL for each OAuth provider you’re setting up.With Detected Library
If OAuth Init detects a supported library, you’ll see:[provider] placeholder in the callback pattern is automatically replaced with the specific provider name (e.g., google, github, discord).
Without Detected Library
If no supported library is detected, OAuth Init uses a generic callback pattern:/oauth/callback/[provider].
Examples by Library
Next Auth / Auth.js
- Google:
http://localhost:3000/api/auth/callback/google - GitHub:
http://localhost:3000/api/auth/callback/github - Discord:
http://localhost:3000/api/auth/callback/discord
Better Auth
- Google:
http://localhost:3000/api/auth/callback/google - GitHub:
http://localhost:3000/api/auth/callback/github - Discord:
http://localhost:3000/api/auth/callback/discord
Lucia
- Google:
http://localhost:3000/auth/callback - GitHub:
http://localhost:3000/auth/callback - Discord:
http://localhost:3000/auth/callback
Lucia uses a single callback endpoint for all providers, so the provider name is not included in the URL.
Arctic
- Google:
http://localhost:3000/auth/callback/google - GitHub:
http://localhost:3000/auth/callback/github - Discord:
http://localhost:3000/auth/callback/discord
Iron Session
- Google:
http://localhost:3000/api/auth/callback - GitHub:
http://localhost:3000/api/auth/callback - Discord:
http://localhost:3000/api/auth/callback
Iron Session uses a single callback endpoint for all providers.
Customizing Callback URLs
While OAuth Init provides default callback URLs based on detected libraries, you can always customize them during the interactive setup:- Using a different port than 3000
- Deploying to a production domain
- Using custom routing patterns
- Running multiple environments (development, staging, production)