GuidesAuth Providers
Facebook Auth
Add Facebook OAuth sign-in to your app.
Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter (X).
1. Create a Facebook App
- Go to Meta for Developers and click My Apps → Create App
- In Add use case section select Authenticate and request data from users with Facebook Login
- Fill in the the details and click Create App
- On App Dashboard Click "Customize the Authenticate and request data from users with Facebook Login use case"
- Click + Add next to email
- In the left sidebar, Go to App Settings → Basic:
- Fill the details (icon
- Privacy policy URL
https://yourdomain.com/legal/privacy - Terms of Service URL
https://yourdomain.com/legal/terms - User data deletion
https://yourdomain.com/legal/terms - Pick a Category
- Copy the App ID — this is your
APP_ID - Copy the App Secret — this is your
APP_SECRET7 Go to App Settings → Advanced: - Authorize callback URL
https://yourdomain.com/api/auth/callback/facebook
2. Set Environment Variables
# .env.local
FACEBOOK_CLIENT_ID=your-app-id
FACEBOOK_CLIENT_SECRET=your-app-secret3. Enable in Config
In src/appConfig.ts set:
facebook: { enabled: true },4. Test
- Run
pnpm dev - Navigate to
/auth/sign-in - A Sign in with Facebook button will appear
While your app is in Development mode, only users listed as app testers or developers can sign in. Switch to Live for public access.
Production Checklist
- Switch the app from Development to Live mode in the app dashboard
- Make sure the
emailandpublic_profilepermissions are approved (they are by default for basic use)
Troubleshooting
- No email returned — Facebook may omit email for phone-only accounts or when the user hasn't granted email permission. This is a Facebook limitation.
Invalid OAuth redirect URI— the redirect URI must exactly match what's configured in Facebook Login settings- No Facebook button — check
FACEBOOK_CLIENT_IDandFACEBOOK_CLIENT_SECRETare set andfacebook.enabledistrue