> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/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.

**1. Create the integration**

In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Facebook*.

> [!NOTE]
>
> Nango has a [Nango-managed OAuth app](https://nango.dev/docs/guides/auth/auth-guide.md#nango-managed-oauth-apps) you can use in development and production. Select it when you create the integration.

**2. 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.

**3. 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 [Environment API key](https://nango.dev/docs/reference/backend/http-api/api-keys.md), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

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

> [tab] 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({ apiKey: '<NANGO-API-KEY>' });
>
> const res = await nango.get({
>     endpoint: '/me',
>     params: {
>       fields: 'id,name,email'
>     },
>     providerConfigKey: '<INTEGRATION-ID>',
>     connectionId: '<CONNECTION-ID>'
> });
>
> console.log(res.data);
> ```

Or fetch credentials with the [Node SDK](https://nango.dev/docs/reference/backend/backend-sdk/node.md#get-a-connection-with-credentials) or [API](https://nango.dev/docs/reference/backend/http-api/connections/get.md).

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

**4. Implement Nango in your app**

Follow our [Auth implementation guide](https://nango.dev/docs/guides/primitives/auth.md) to integrate Nango in your app.

To use your own OAuth app instead of the Nango-managed one, follow the setup guide linked below.

## 📚 Facebook Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Facebook OAuth app](https://nango.dev/docs/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 & tools for Facebook

Explore Nango-provided tools in your dashboard. Extend and customize them to fit your needs.

### Others

| Function name | Description | Type |
| - | - | - |
| `create-page-photo` | Publish a photo to a Facebook Page. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-page-post` | Publish a post to a Facebook Page feed. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-page-video` | Publish a video to a Facebook Page. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-post-comment` | Create a comment on a Facebook post | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-scheduled-page-post` | Schedule a future post on a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-comment` | Delete a Facebook comment by comment ID | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `delete-post` | Delete a Facebook Page post by post ID | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-comment` | Retrieve a Facebook comment by comment ID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-page-app-subscriptions` | Retrieve app subscriptions configured on a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-page` | Retrieve Facebook Page metadata by page ID | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-post` | Retrieve a Facebook post by post ID | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-user-profile` | Retrieve the authenticated Facebook user profile or another accessible user object. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-page-posts` | List posts from a Facebook Page feed. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-page-scheduled-posts` | List scheduled posts for a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-page-videos` | List videos published on a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-post-comments` | List comments on a Facebook post with pagination support | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-user-pages` | List Facebook Pages the authenticated user can access | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `subscribe-app-to-page` | Subscribe the app to receive updates for a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `unsubscribe-app-from-page` | Remove the app subscription from a Facebook Page | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `page-posts` | Sync posts from Facebook Pages the connection can access. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `page-scheduled-posts` | Sync scheduled unpublished posts for Facebook Pages in scope | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `page-videos` | Sync videos published on Facebook Pages in scope. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `pages` | Sync Facebook Pages the authenticated user can access | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.