1.0.0 • Published 1 year ago
facebook-sync v1.0.0
Facebook Sync Project
This project connects to Facebook through the Facebook Business SDK and retrieves information such as campaigns, ad sets, ads, lead forms, and more.
Installation
- Clone the repository.
- Install dependencies by running:
npm install
- Set up environment variables by creating a .env file with the following variables:
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token
FACEBOOK_ACCOUNT_ID=your_facebook_account_id
FACEBOOK_CAMPAIGN_ID=your_facebook_campaign_id
DEBUG=true
PRODUCT=your_product_name
Keep in mind that this project validates the environment variables before start so ZOD(the validation library) will throw an error if any variable is missing
Usage
To run the project in development mode, use:
npm run dev
Code Overview
src/index.ts
: Entry point of the application.src/facebook/get-information-from-facebook.ts
: Contains functions to retrieve campaign and ad set information from Facebook using the Facebook Business SDK.src/adapters/*
: Contains the rules to import the data to the projects
1.0.0
1 year ago