> ## Documentation Index
> Fetch the complete documentation index at: https://www.anything.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook Login

> Let users login to your app with their Facebook accounts

Let users sign in to your app with their Facebook accounts. They'll share their email, name, and profile picture.

<Warning>
  **Facebook Login is not yet available for mobile apps.** We are working on this feature. Currently, Facebook Login only works for web apps published to custom domains. Per Apple's App Store guidelines, Facebook SSO cannot be present in iOS mobile builds until the "Sign in with Apple" feature is released.
</Warning>

You'll need to set up a few things in Facebook first, then add those settings to Anything.

## Before you start

Make sure you have:

<Check>
  An Anything project with [User Accounts](/apps/auth) turned on
</Check>

<Check>
  Your app running on a custom domain through [Anything's domain setup](/launch/domains)
</Check>

## Overview

<CardGroup cols={2}>
  <Card title="Set Up Facebook App" icon="key">
    Set up Facebook OAuth
  </Card>

  <Card title="Add keys to Anything" icon="plug">
    Add credentials to Anything
  </Card>

  <Card title="Add sign-in UI" icon="pencil">
    Customize the login button
  </Card>

  <Card title="Test flow" icon="check-circle">
    Make sure login works
  </Card>
</CardGroup>

## Facebook Setup

<Steps>
  <Step title="Access Facebook Developers">
    1. Go to [Facebook for Developers](https://developers.facebook.com)
    2. Sign in with your Facebook account
    3. Click "My Apps" in the top right

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/1-signindevelopers.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=a96849c48f40b57ff742341514cedcc7" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/1-signindevelopers.png" />
  </Step>

  <Step title="Create New App">
    1. Click "Create App" from the dashboard
    2. You'll be taken to the app creation screen

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/2-createapp.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=a60fc2f0af77a00c3b2c7ba92a095223" style={{ borderRadius: '0.5rem' }} width="3456" height="2080" data-path="images/auth/facebook/2-createapp.png" />
  </Step>

  <Step title="Configure App Details">
    1. Enter your app name
    2. Add your contact email
    3. Click "Create App"

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/3-namecontact.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=a0e4d2d741bd62fe779c7d6fd16e9356" style={{ borderRadius: '0.5rem' }} width="3456" height="2080" data-path="images/auth/facebook/3-namecontact.png" />

    <Warning>
      Choose an app name that clearly represents your business or service - this will be visible to users
    </Warning>
  </Step>

  <Step title="Add Facebook Login">
    1. On the product selection screen
    2. Find and select "Facebook Login"
    3. This will add the login capability to your app

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/4-choosefblogin.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=92fa2a974f21fad56f5346b171398151" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/4-choosefblogin.png" />
  </Step>

  <Step title="Business Portfolio Setup">
    1. Choose whether to add your app to a business portfolio
    2. You can skip this step for now during development
    3. You'll need to complete this before launching

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/5-businessportfolios.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=475eb85041cea44270a40e052648c708" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/5-businessportfolios.png" />
  </Step>

  <Step title="Complete Initial Setup">
    1. Click "Go to Dashboard" to finalize the initial setup
    2. This will take you to your app's main dashboard

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/6-finalize.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=24c64643715a8b01d901928c22c851de" style={{ borderRadius: '0.5rem' }} width="3442" height="2038" data-path="images/auth/facebook/6-finalize.png" />
  </Step>

  <Step title="Configure Email Permission (Optional)">
    1. Navigate to App Settings > Permissions
    2. Add the email permission if you want to receive user email addresses
    3. This is optional but recommended if your app needs to email users

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/7-permissionsaddemail.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=0d273683dbebfdc9c0d11fa38d036748" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/7-permissionsaddemail.png" />
  </Step>

  <Step title="Access Settings">
    1. In the left sidebar, click "Facebook Login > Settings"
    2. This is where you'll configure the OAuth settings

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/8-settings.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=304b4507ef9d3451bff3aeea786227f1" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/8-settings.png" />
  </Step>

  <Step title="Configure OAuth Redirect URI">
    1. Under "Valid OAuth Redirect URIs"
    2. Add: `https://www.your-domain.com/api/auth/callback/facebook`
    3. Replace "your-domain.com" with your actual domain

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/9-oauthredirecturi.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=436992d4ac924d0b04690b00cccf7c0a" style={{ borderRadius: '0.5rem' }} width="3456" height="1984" data-path="images/auth/facebook/9-oauthredirecturi.png" />

    <Warning>
      Must include:

      * `https://` protocol
      * `www` prefix in the domain
      * Exact domain used in Anything's custom domain settings
      * Valid CNAME record for `www` subdomain in DNS
    </Warning>
  </Step>

  <Step title="Save OAuth Settings">
    1. Scroll to the bottom of the settings page
    2. Click "Save Changes" to store your OAuth configuration

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/10-savechanges.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=c1bf6c5851a6a0f58de8dfe2bb4a3b73" style={{ borderRadius: '0.5rem' }} width="3456" height="2076" data-path="images/auth/facebook/10-savechanges.png" />
  </Step>

  <Step title="Go to Basic Settings">
    1. Navigate to Settings > Basic in the left sidebar
    2. This section contains your app credentials and core settings

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/11-basicsettings.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=99281b9baff6764e833a7919a3144c9d" style={{ borderRadius: '0.5rem' }} width="3456" height="2076" data-path="images/auth/facebook/11-basicsettings.png" />
  </Step>

  <Step title="Copy App Credentials">
    1. Find your App ID
    2. Click "Show" to reveal your App Secret
    3. Save both values - you'll need them for Anything setup

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/12-copyidsecret.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=7701a471f1cb438252ee7a7486cb20e2" style={{ borderRadius: '0.5rem' }} width="3456" height="2082" data-path="images/auth/facebook/12-copyidsecret.png" />

    <Warning>
      Keep your App Secret secure - never share it publicly
    </Warning>
  </Step>

  <Step title="Complete Basic Settings (Later)">
    <Note>
      Before launching, you'll need to complete these additional settings:
    </Note>

    1. Add your domain with `www` prefix
    2. Add Privacy Policy URL
    3. Add User Data Deletion Policy URL
    4. Add Terms of Service URL

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/13-domainprivacydatadeletion.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=2df0963fd74019e49a3c7c7fc6e14739" style={{ borderRadius: '0.5rem' }} width="3456" height="2080" data-path="images/auth/facebook/13-domainprivacydatadeletion.png" />

    <Tip>
      You can use services like Termly to generate these required policy documents and then host them on pages in your Anything app.
    </Tip>
  </Step>

  <Step title="Business Verification (Later)">
    <Note>
      Required before launching your app:
    </Note>

    1. Complete the business verification process
    2. Provide required documentation
    3. Wait for Facebook's review

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/14-businessverification.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=b7df2c75c48129ffa32bd344a86b6b01" style={{ borderRadius: '0.5rem' }} width="3456" height="2082" data-path="images/auth/facebook/14-businessverification.png" />
  </Step>

  <Step title="Publish Your Facebook App (Later)">
    <Note>
      Final step before going live:
    </Note>

    1. Navigate to the App Dashboard
    2. Switch your app from Development to Live mode
    3. Complete any remaining verification steps

    <img src="https://mintcdn.com/create/0uSd9vqrMRrQ_VKJ/images/auth/facebook/15-publish.png?fit=max&auto=format&n=0uSd9vqrMRrQ_VKJ&q=85&s=5bfc43a5cf82121bb17eeb46658d4145" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/facebook/15-publish.png" />
  </Step>
</Steps>

## Add to Anything project

<Steps>
  <Step title="Enable User Accounts">
    You have two options:

    1. Prompt Anything with "Let users sign in"
    2. Enable User Accounts from the logo menu
  </Step>

  <Step title="Access Project Settings">
    1. Click the 3-dot menu at the top of the chat
    2. Select "Project Settings"

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/x/17-createprojectsettings.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=1de878b5c2f0f5729d59527d3ce92c05" style={{ borderRadius: '0.5rem' }} width="3456" height="2078" data-path="images/auth/x/17-createprojectsettings.png" />
  </Step>

  <Step title="Enable Facebook Login">
    1. Navigate to the Authentication section
    2. Find Facebook Login toggle
    3. Turn it on

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/16-enablefb.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=e43e69d247e3b952ec29b38b76f35c33" style={{ borderRadius: '0.5rem' }} width="3456" height="2074" data-path="images/auth/facebook/16-enablefb.png" />
  </Step>

  <Step title="Add Facebook Credentials">
    1. Paste in your App ID
    2. Paste in your App Secret
    3. Click Save

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/16-enablefb.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=e43e69d247e3b952ec29b38b76f35c33" style={{ borderRadius: '0.5rem' }} width="3456" height="2074" data-path="images/auth/facebook/16-enablefb.png" />
  </Step>

  <Step title="Add Sign In UI">
    1. Return to the chat
    2. Prompt Anything with "Add Facebook Login as an option"
    3. Anything will update your sign-in pages automatically

    <img src="https://mintcdn.com/create/Gl2O6oYpcGusVDs1/images/auth/facebook/17-promptcreate.png?fit=max&auto=format&n=Gl2O6oYpcGusVDs1&q=85&s=21e933399a28213bc5b23cc9b82c525d" style={{ borderRadius: '0.5rem' }} width="3456" height="2076" data-path="images/auth/facebook/17-promptcreate.png" />
  </Step>

  <Step title="Publish Your App">
    1. Click the Publish button
    2. Review your changes
    3. Publish to make the Facebook Login feature live
  </Step>
</Steps>

## Testing

1. Publish your changes
2. Open your app in a new incognito window
3. Go to the sign in page
4. Try signing in with Facebook
5. Check the [auth\_users table](/apps/databases) to see your new user

## Troubleshooting

<Accordion title="Can't see the Facebook button">
  * Check if User Accounts is turned on
  * Make sure Facebook Login is enabled in Project Settings
  * Try publishing your changes again
  * Clear your browser data and try in incognito mode
</Accordion>

<Accordion title="Login not working">
  * Double check your domain is exactly the same in Anything and Facebook
  * Make sure your callback URL is right: `www.your-domain.com/api/auth/callback/facebook`
  * Check if your App ID and Secret are pasted correctly
  * Verify your domain is set up in Facebook
  * Make sure your app is live at your custom domain
</Accordion>

<Accordion title="Users can't sign in after domain change">
  * Update the OAuth Redirect URIs in Facebook
  * Update your App Domains in Facebook
  * Re-publish your app on the new domain
</Accordion>

## FAQ

<Accordion title="What user info do I get?">
  By default:

  * Email address
  * Name
  * Profile picture (if they have one)

  Additional information requires requesting extra permissions and may require Facebook app review.
</Accordion>

<Accordion title="Can I change how the login button looks?">
  Yes! Just:

  1. Go back to chat
  2. Tell Anything how you want it to look
  3. Anything will help style it while following Facebook's rules
</Accordion>

<Accordion title="Do I need Facebook to review my app?">
  * For basic login: No
  * For extra features: Yes
  * You'll need to submit your app to Facebook for approval
</Accordion>

## See Also

* [User Accounts](/apps/auth)
* [Customizing Login Pages](/apps/auth#customizing-auth-pages)
