Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can you use node.js with facebook graph api?


Asked by Jaylah Rowe on Dec 03, 2021 Node.js



The Graph API docs have no examples using vanilla JavaScript (although there are a few examples using their client-side SDK). At the time of this writing (March 12th, 2017), there are very few blog posts or tutorial on the topic. If you have some examples, using Facebook's Graph API with Node.js is fun.
Also,
Use graph API to get some page’s posts you must have a access token which has the “Page Public Content Access” permission, it’s too complicated creating a new Facebook App to get the access token by myself.
In this manner, Here's some context about pairing Node.js with Facebook's Graph API. Facebook has a JavaScript SDK for interacting with their Graph API, but it's for client-side JavaScript – there is no Node.js SDK.
Moreover,
Although there are several NPM packages for working with Facebook's Graph API, no NPM package seems to be as mature as packages for other social media platforms like Twit for the Twitter API. The best of the few seems to be facebook-node-sdk, but I hesitate to rely on it for a business critical app.
Just so,
Open the Azure Cloud Shell and start executing the below commands. Install node.js, Express, and npm. Below is the code file for accessing the Graph API. Refer to the source code for complete details. Run the below command in your VS Code Terminal. Drag and drop the zip file at the below URL. It will automatically get unzipped and deployed.