This Node.js application leverages the Facebook Graph API to retrieve basic user information. It is designed to make periodic API calls, initially set at 2-second intervals, and employs mechanisms to handle API rate limits by adapting the request frequency based on API feedback.
- Node.js (version recommended: 14.x or higher)
- npm (version 20.11.1)
- A Facebook Developer account and a Facebook App (for the API access token)
-
Clone the Repository
Start by cloning this repository to your local machine.
-
Install Dependencies
Use npm to install the project's dependencies. Ensure you're using npm version 20.11.1 to match the project's setup requirements:
npm install
-
Configure Environment Variables
You need to set your Facebook API access token in an environment variable for the application to authenticate requests. Create a
.env
file in the root directory of the project:FACEBOOK_ACCESS_TOKEN=YourAccessTokenHere
Replace
YourAccessTokenHere
with your actual access token obtained from the Facebook Developer portal.
To run the application, use the following npx command from the root directory:
npx ts-node src/main.ts