Manage Facebook ads with the official facebook-js-ads-sdk. For startup founders.
intermediate⏱ 30 minutes💵 Free (self-hosted)
141 stars57 forksJavaScriptQuality 8/10Updated 11/11/2017100% free · open source
What it is
Use the Facebook SDK to connect to the Facebook API in your Node.js project.
What you can make with it
Automations like: pull Facebook ad data into a Node.js app and create a custom report.
How it helps
This SDK helps developers avoid the hassle of manually handling Facebook API authentication and rate limits.
Real use case example
"A marketer uses this SDK to connect to the Facebook API, fetch their ad metrics, and create a daily report in their Node.js app."
If you're new
Pick this up when you understand JavaScript basics and want to connect to the Facebook API.
If you're senior
Reach for this when you need to integrate Facebook Ads data into a custom Node.js application.
Common confusion cleared up
Don't confuse this SDK with its deprecation status – it's still useful for legacy projects or custom integrations.
Best inside these AI tools
Self-hostedAny AI Client
Pairs with
Stripe webhookNotion databaseClaude API
Why we list it on WorkflowStacks: The marketplace includes this SDK because it's the official Facebook SDK for Node.js, saving you time and effort.
What it does
Manage Facebook ads programmatically using the official Facebook JavaScript Ads SDK
Install / run
npm install facebook-js-ads-sdk
When to use it
•When automating Facebook ad campaigns
•When integrating Facebook ads with other marketing tools
•When building a custom Facebook ads dashboard
Quick start
1Create a Facebook Developer account and register an app to obtain an App ID and App Secret
2Create a token using the Facebook OAuth flow, as described in the README
3Initialize the SDK with your App ID, App Secret, and token, like this: `const adsSdk = require('facebook-js-ads-sdk'); const api = adsSdk.FacebookAdsApi.init('YOUR_APP_ID', 'YOUR_APP_SECRET', 'YOUR_TOKEN');`
4Use the `api` object to create and manage ad campaigns, ad sets, and ads, such as `const campaign = await api.createCampaign({ name: 'My Campaign', objective: 'CONVERSIONS' });`
5Handle errors and logging using the `try-catch` block and the `api.getLogger()` method
Ready-to-paste prompt
Create a new ad campaign with the objective 'CONVERSIONS' and a budget of $100: `const campaign = await api.createCampaign({ name: 'My Campaign', objective: 'CONVERSIONS', budget: 100 });`
Heads up: You need to have a Facebook Developer account and a registered app to obtain an App ID and App Secret, which are required to authenticate with the Facebook Ads API
Saves to your device
Topics
facebook
facebook-api
isomorphic
javascript
marketing-api
nodejs
sdk
What's inside — free to inspect
No purchase needed
Read the entire source before you build — unlike paid marketplaces that hide it behind a buy button.
12
top-level files
2
folders
727K
repo size
—
license
Key files
.editorconfig
package.json
README.md
File tree
src/
test/
.babelrc
.editorconfig
.gitattributes
.gitignore
.npmignore
.travis.yml
bower.json
gulpfile.js
marketingapi.png
package.json
README.md
yarn.lock
Quick Actions
Details
Creator
lucasrcosta
Language
JavaScript
Category
marketing
Published
12/4/2014
Are you the creator of this tool? Claim your listing → and earn 85% of every sale.