@orchesty/connector-facebook-ads
v2.0.0
Published
[](https://www.npmjs.com/package/@orchesty/connector-facebook-ads) [](https://github.com/Orchesty/orchesty
Readme
Facebook Ads Connector
An Orchesty connector for Facebook Ads, the Meta advertising platform that allows businesses to create and manage ad campaigns across Facebook, Instagram, Messenger, and WhatsApp.
Application Type
OAuth 2.0
This connector uses the Facebook OAuth 2.0 authorization flow with the ads_management and ads_read scopes. After entering your credentials in Orchesty, you will be redirected to Facebook to authorize access.
| Field | Description |
|---|---|
| client_id | Your Meta app Client ID from the Meta Developer Portal |
| client_secret | Your Meta app Client Secret from the Meta Developer Portal |
Components
| Class | Type | Description |
|---|---|---|
| FacebookCreateCampaigns | Connector | Creates a new ad campaign for an ad account via POST /v12.0/act_{accountId}/campaigns |
Setup
Credentials
- Go to Meta for Developers and create a new app (type: Business).
- Add the Marketing API product to your app.
- Under Settings → Basic, note the App ID (Client ID) and App Secret (Client Secret).
- Under App Review, request access to the
ads_managementandads_readpermissions. - Add the Orchesty OAuth callback URL to Valid OAuth Redirect URIs under Facebook Login → Settings.
- In Orchesty, open the Facebook Ads application settings, fill in the Client ID and Client Secret, then complete the OAuth authorization flow.
API Documentation
Meta Marketing API: https://developers.facebook.com/docs/marketing-api/
Installation & Usage
Install the package:
npm install @orchesty/connector-facebook-ads @orchesty/nodejs-sdk
# or
pnpm add @orchesty/connector-facebook-ads @orchesty/nodejs-sdkRegister the application and nodes in your Orchesty DI container:
import { container } from '@orchesty/nodejs-sdk';
import { OAuth2Provider } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
import FacebookAdsApplication from '@orchesty/connector-facebook-ads/dist/FacebookAdsApplication';
import FacebookCreateCampaigns from '@orchesty/connector-facebook-ads/dist/Connector/FacebookCreateCampaigns';
const app = new FacebookAdsApplication(container.get(OAuth2Provider));
container.setApplication(app);
container.setNode(new FacebookCreateCampaigns(), app);License
This connector is released under the Apache License 2.0. See the LICENSE file for the full license text.
Contributing
Contributions are welcome! This connector is part of the open-source Orchesty Node.js Connectors monorepo.
For guidelines on how to create or update connectors — including project setup, coding conventions, and how to write tests — please refer to the Contributing to Connectors guide.
All contributions should include:
- Source code in
src/following the existing connector structure - Tests in
src/**/__tests__/withinput.json,mock.json, andoutput.jsonfixtures - An updated
CHANGELOG.mdentry
