Facebook Provider
Resources
Setup
Callback URL
https://example.com/api/auth/callback/facebook
Environment Variables
AUTH_FACEBOOK_ID
AUTH_FACEBOOK_SECRET
Configuration
/auth.ts
import NextAuth from "next-auth"
import Facebook from "next-auth/providers/facebook"
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [Facebook],
})
Notes
- Production applications cannot use localhost URLs to sign in with Facebook. You need to use a dedicated development application in Facebook to use localhost callback URLs.
- Email address may not be returned for accounts created on mobile.
clientId
is your Facebook App ID,clientSecret
is your Facebook App Secret.