> ## Documentation Index
> Fetch the complete documentation index at: https://nango-wari-migrated-bigcommerce-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook

> Integrate your application with the Facebook API

## 🚀 Quickstart

Connect to Facebook with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Facebook*.
  </Step>

  <Step title="Authorize Facebook">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Facebook. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Facebook API">
    Let's make your first request to the Facebook API (fetch authenticated user profile information). Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/me?fields=id,name,email" \
          -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
            endpoint: '/me',
            params: {
              fields: 'id,name,email'
            },
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Facebook Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Facebook OAuth app](/api-integrations/facebook/how-to-register-your-own-facebook-api-oauth-app)\
  Register an OAuth app with Facebook and obtain credentials to connect it to Nango

Official docs: [Facebook API docs](https://developers.facebook.com/docs/)

## 🧩 Pre-built syncs & actions for Facebook

Enable them in your dashboard. Extend and customize to fit your needs.

### Others

| Function name                | Description                                                                         | Type                                           | Source code                                                                                                                         |
| ---------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `create-page-photo`          | Publish a photo to a Facebook Page.                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/create-page-photo.ts)          |
| `create-page-post`           | Publish a post to a Facebook Page feed.                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/create-page-post.ts)           |
| `create-page-video`          | Publish a video to a Facebook Page.                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/create-page-video.ts)          |
| `create-post-comment`        | Create a comment on a Facebook post                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/create-post-comment.ts)        |
| `create-scheduled-page-post` | Schedule a future post on a Facebook Page                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/create-scheduled-page-post.ts) |
| `delete-comment`             | Delete a Facebook comment by comment ID                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/delete-comment.ts)             |
| `delete-post`                | Delete a Facebook Page post by post ID                                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/delete-post.ts)                |
| `get-comment`                | Retrieve a Facebook comment by comment ID.                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/get-comment.ts)                |
| `get-page-app-subscriptions` | Retrieve app subscriptions configured on a Facebook Page                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/get-page-app-subscriptions.ts) |
| `get-page`                   | Retrieve Facebook Page metadata by page ID                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/get-page.ts)                   |
| `get-post`                   | Retrieve a Facebook post by post ID                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/get-post.ts)                   |
| `get-user-profile`           | Retrieve the authenticated Facebook user profile or another accessible user object. | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/get-user-profile.ts)           |
| `list-page-posts`            | List posts from a Facebook Page feed.                                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/list-page-posts.ts)            |
| `list-page-scheduled-posts`  | List scheduled posts for a Facebook Page                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/list-page-scheduled-posts.ts)  |
| `list-page-videos`           | List videos published on a Facebook Page                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/list-page-videos.ts)           |
| `list-post-comments`         | List comments on a Facebook post with pagination support                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/list-post-comments.ts)         |
| `list-user-pages`            | List Facebook Pages the authenticated user can access                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/list-user-pages.ts)            |
| `subscribe-app-to-page`      | Subscribe the app to receive updates for a Facebook Page                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/subscribe-app-to-page.ts)      |
| `unsubscribe-app-from-page`  | Remove the app subscription from a Facebook Page                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/actions/unsubscribe-app-from-page.ts)  |
| `page-posts`                 | Sync posts from Facebook Pages the connection can access.                           | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/syncs/page-posts.ts)                   |
| `page-scheduled-posts`       | Sync scheduled unpublished posts for Facebook Pages in scope                        | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/syncs/page-scheduled-posts.ts)         |
| `page-videos`                | Sync videos published on Facebook Pages in scope.                                   | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/syncs/page-videos.ts)                  |
| `pages`                      | Sync Facebook Pages the authenticated user can access                               | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/facebook/syncs/pages.ts)                        |

***
