> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Facebook as your sign in option

Add Sign in with Facebook to your app: create a Meta app, register the Scalekit redirect URI and connect the app to Scalekit for social login.
This guide is for developers who want users to sign in to their app with a Facebook account. By the end, you'll have a Facebook connection in Scalekit that uses your own Meta app, and a successful test sign-in.

<figure>
  > Image: A diagram showing "Your Application" connecting to "Scalekit" via OpenID Connect, which links to Facebook using OAuth 2.0.
</figure>

Before you start, you need:

- A Scalekit environment
- A [Meta for Developers](https://developers.facebook.com/) account

## Add a Facebook connection in Scalekit

1. Open social login settings

   In the Scalekit dashboard, go to **Authentication** > **Auth Methods** > **Social Login**.

2. Open the Facebook connection

   Next to **Facebook**, click **Edit**.

   <figure>
     > Image: Scalekit dashboard Social Login list under Authentication, Auth Methods, with Facebook below Google, Microsoft, GitHub, LinkedIn, GitLab and Salesforce.
   </figure>

3. Copy the redirect URI

   The **OAuth Configuration** page shows a **Redirect URI**. Copy it; you register it with Meta in the next section. Keep this page open to paste the **Client ID** and **Client Secret** from your Meta app. The **Scopes** are set to `email` and `public_profile`.

   <figure>
     > Image: Facebook OAuth Configuration page in Scalekit, showing the Redirect URI, empty Client ID and Client Secret fields, and the email and public_profile scopes.
   </figure>

## Create a Meta app

1. Create the app

   In [Meta for Developers](https://developers.facebook.com/apps/), click **Create app**. When asked for a use case, choose **Authenticate and request data from users with Facebook Login**.

2. Add the email permission

   In the app dashboard, go to **Use cases** and click **Customize** on the Facebook Login use case. On **Permissions and features**, click **Add** next to `email`. Scalekit requests `email` and `public_profile`, and it needs the email address to sign the user in.

   Check that `email` and `public_profile` both show **Ready for testing**. Leave the other permissions as they are.

   <figure>
     > Image: Meta app use case Permissions and features page, with the email and public_profile permissions showing Ready for testing.
   </figure>

3. Register the redirect URI

   In the same use case, open **Settings**. Paste the Scalekit redirect URI into **Valid OAuth Redirect URIs**, make sure **Client OAuth login** and **Web OAuth login** are on, and save.

4. Copy the app credentials

   In **App settings** > **Basic**, copy the **App ID**. Click **Show** next to **App secret** and copy the secret.

   <figure>
     > Image: Meta app settings Basic page, showing the App ID field and the App secret field with its Show button.
   </figure>

## Connect the Meta app to Scalekit

1. Paste the App ID into **Client ID** and the App secret into **Client Secret**
2. Click **Save changes**
3. Click **Enable**

## Test the connection

1. Click **Test Connection** in Scalekit
2. Sign in with a Facebook account that has a role on your Meta app (admin, developer or tester), and approve the consent screen
3. Check the summary table: it lists the attributes Scalekit received from Facebook, such as the user's ID, name and email

<figure>
  > Image: Successful Facebook test connection in Scalekit, listing the attributes received from Facebook: sub, email, name, first_name, id and last_name.
</figure>

## Go live

While your Meta app is in development mode, only people with a role on the app can sign in. To let any Facebook user sign in, complete the steps Meta lists on the app dashboard (such as adding a privacy policy URL) and switch the app to **Live**.

## How Facebook sign-in behaves

- **Email address.** Scalekit signs the user in with the email address on their Facebook account. If the account has no email address, or the user removes the email permission on the consent screen, the sign-in fails with a missing email error. Ask the user to sign in another way, or to add an email address to their Facebook account and try again.
- **Email verification.** Facebook doesn't tell Scalekit whether the email address is verified. Scalekit asks the user to verify their email the first time they sign in with Facebook.
- **Profile picture.** Scalekit sends the user's Facebook profile picture. Users who haven't set one get no picture rather than Facebook's default placeholder.
- **App secret proof.** Scalekit signs its Graph API calls with an `appsecret_proof`, so you can turn on **Require App Secret** in your Meta app's advanced settings.

> tip
>
> To send users straight to Facebook instead of the hosted login page, pass `provider=facebook` in the [authorization URL](/sso/guides/authorization-url/).

## Next steps

Add the connection to your login flow: see [Social logins](/authenticate/auth-methods/social-logins/).


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
