diff --git a/docs/content/docs/authentication/facebook.mdx b/docs/content/docs/authentication/facebook.mdx
index fc27192e..1837344b 100644
--- a/docs/content/docs/authentication/facebook.mdx
+++ b/docs/content/docs/authentication/facebook.mdx
@@ -34,9 +34,14 @@ description: Facebook provider setup and usage.
},
})
```
+
+
+ BetterAuth also supports Facebook Login for Business, all you need
+ to do is provide the `configId` as listed in **Facebook Login For Business > Configurations** alongside your `clientId` and `clientSecret`. Note that the app must be a Business app and, since BetterAuth expects to have an email address and account id, the configuration must be of the "User access token" type. "System-user access token" is not supported.
+
- ### Sign In with Facebook
+ ### Sign In with Facebook
To sign in with Facebook, you can use the `signIn.social` function provided by the client. The `signIn` function takes an object with the following properties:
- `provider`: The provider to use. It should be set to `facebook`.
diff --git a/packages/better-auth/src/social-providers/facebook.ts b/packages/better-auth/src/social-providers/facebook.ts
index b1258bd4..c234f68a 100644
--- a/packages/better-auth/src/social-providers/facebook.ts
+++ b/packages/better-auth/src/social-providers/facebook.ts
@@ -25,6 +25,11 @@ export interface FacebookOptions extends ProviderOptions {
* @default ["id", "name", "email", "picture"]
*/
fields?: string[];
+
+ /**
+ * The config id to use when undergoing oauth
+ */
+ configId?: string;
}
export const facebook = (options: FacebookOptions) => {
@@ -45,6 +50,11 @@ export const facebook = (options: FacebookOptions) => {
state,
redirectURI,
loginHint,
+ additionalParams: options.configId
+ ? {
+ config_id: options.configId,
+ }
+ : {},
});
},
validateAuthorizationCode: async ({ code, redirectURI }) => {