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

# Facebook setup

> Register the Facebook application and give PostQueen its keys

On your own instance the Meta app is yours: create it in Meta for Developers, then put its App ID and App Secret in your environment.

<Warning>
  **NOTE:** Please be advised that Instagram and Facebook can use the same app (no need to create two separate apps)
</Warning>

<Steps>
  <Step title="Create a new app">
    Select a business portfolio, then create a [new app in Facebook developers](https://developers.facebook.com/apps/creation/).

    Please be advised that for public applications, you will need to verify your business.

    <Frame>
      <img src="https://mintcdn.com/forceplay/Gsgj4WOu3HFxkte6/images/providers/facebook/Business-Portfolio.png?fit=max&auto=format&n=Gsgj4WOu3HFxkte6&q=85&s=8d4bb9d2ca1f5549dd1ce241530be025" alt="Business Portfolio" width="1854" height="511" data-path="images/providers/facebook/Business-Portfolio.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/forceplay/Gsgj4WOu3HFxkte6/images/providers/facebook/Create-an-app.png?fit=max&auto=format&n=Gsgj4WOu3HFxkte6&q=85&s=564d83ff620d42b1781da16c21c8be82" alt="Create app" width="1332" height="555" data-path="images/providers/facebook/Create-an-app.png" />
    </Frame>
  </Step>

  <Step title="Select app type">
    Select "Other" and click next

    <Frame>
      <img src="https://mintcdn.com/forceplay/Gsgj4WOu3HFxkte6/images/providers/facebook/Other-app-use-cases.png?fit=max&auto=format&n=Gsgj4WOu3HFxkte6&q=85&s=bff5d32d3905b25ca707f8efca5e99e6" alt="Other app use cases" width="1074" height="996" data-path="images/providers/facebook/Other-app-use-cases.png" />
    </Frame>
  </Step>

  <Step title="Select business">
    Then select business

    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-select-business.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=c24713672ba4e5af8bfeeb3b0240088e" alt="Business" width="1044" height="498" data-path="images/providers/facebook/facebook-select-business.png" />
    </Frame>
  </Step>

  <Step title="Add details and create app">
    Add all your details and click Create App

    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-create-app-details.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=e1eb94cb041fcecb25405ce5363e53b0" alt="Create app details" width="1038" height="452" data-path="images/providers/facebook/facebook-create-app-details.png" />
    </Frame>
  </Step>

  <Step title="Set up Login with Facebook">
    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-setup-login.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=cfa43e60de09e08a55a9193f14942069" alt="Setup Login with Facebook" width="1447" height="1170" data-path="images/providers/facebook/facebook-setup-login.png" />
    </Frame>

    Set up login for business
  </Step>

  <Step title="Configure redirect URI">
    Set up a redirect URI back to the application

    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-redirect-uri.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=5a8c2db4fe2262a42c70df663ff86bbf" alt="Redirect URI" width="986" height="677" data-path="images/providers/facebook/facebook-redirect-uri.png" />
    </Frame>

    <Snippet file="oauth2redirect.mdx" />

    **Your Facebook OAuth2 Redirect URI:**

    * Production: `https://postqueen.example.com/integrations/social/facebook`
    * Local development: `http://localhost:4200/integrations/social/facebook`
    * Docker: `http://localhost:4007/integrations/social/facebook`
  </Step>

  <Step title="Request advanced permissions">
    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-advanced-permissions.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=deff89f61e022bc1a5bd45a00af17c89" alt="Advanced permissions" width="1777" height="1125" data-path="images/providers/facebook/facebook-advanced-permissions.png" />
    </Frame>

    Go to advanced permission and request access for the following scopes:

    * `pages_show_list`
    * `business_management`
    * `pages_manage_posts`
    * `pages_manage_engagement`
    * `pages_read_engagement`
    * `read_insights`

    <Note>
      If your PostQueen install is for personal use only these advanced permissions are not required for PostQueen to function.
    </Note>
  </Step>

  <Step title="Set app mode to Live">
    Change the App Mode from 'Development' to 'Live'. If you do not do this then posts made via the API will display for yourself but will not be visible for other users.
  </Step>

  <Step title="Copy your credentials">
    <Frame>
      <img src="https://mintcdn.com/forceplay/zoNabLaA7ky5oWlO/images/providers/facebook/facebook-app-keys.png?fit=max&auto=format&n=zoNabLaA7ky5oWlO&q=85&s=da8686bcdc5287717152b5eb350f24d8" alt="Keys" width="1527" height="313" data-path="images/providers/facebook/facebook-app-keys.png" />
    </Frame>

    Go to basic permissions copy your App ID and App Secret and paste them in your `.env` file

    ```env theme={"system"}
    FACEBOOK_APP_ID="app id"
    FACEBOOK_APP_SECRET="app secret"
    ```

    Facebook should now be working!
  </Step>

  <Step title="Restart and add the Facebook channel">
    <Snippet file="restart-and-add-channel.mdx" />
  </Step>
</Steps>

## Troubleshooting

### Image is missing from the published post

Check the **App Mode** of your Facebook app. In **Development** mode, posts with media are only visible to app developers/testers. Everyone else sees the post without the image. Switch the app to **Live** mode to make the image visible to all users.

### Facebook posts work for you but not for other users

Same root cause as above: the app is in Development mode. Only roles you have explicitly added (developers, testers, admins) can see content published via the API. Set the app to Live.

## Next steps

<CardGroup cols={2}>
  <Card title="What she can post to Facebook" icon="https://mintcdn.com/forceplay/LL5FipRv-7nhg1To/images/channels/facebook.svg?fit=max&auto=format&n=LL5FipRv-7nhg1To&q=85&s=a51aa0b7e943657840ed6fe1dc0944b2" href="/providers/facebook" width="64" height="64" data-path="images/channels/facebook.svg">
    Limits, post types and settings
  </Card>

  <Card title="Configuration reference" icon="list" href="/configuration/reference">
    Every variable she reads
  </Card>

  <Card title="Connect errors" icon="plug-circle-xmark" href="/troubleshooting/oauth-connect">
    Invalid state, invalid\_grant and the rest
  </Card>

  <Card title="Another channel" icon="plug" href="/providers/overview">
    Every network, and what each one asks for
  </Card>
</CardGroup>
