This is a sample client for Facebook's Webhooks product and Instagram's Subscriptions API, powered by Node.js and written in TypeScript.
Ensure you have Node.js installed.
Create a .env
file in the typescript-server
directory with the following content:
APP_SECRET=your_app_secret
TOKEN=your_verify_token
FROM_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_BEARER_TOKEN=your_app__bearer_token
- Navigate to the
typescript-server
directory:cd typescript-server
- Install the dependencies:
npm install
- Start the server in development mode:
npm run dev
- Alternatively, build and start the server:
npm start
- Refer to Facebook's Webhooks sample app documentation to see how to use this app.
- Set up your Facebook application's Graph API Webhooks subscription using
https://<your-domain>/facebook
as the callback URL.
-
Register an Instagram API client.
-
Set up your client's subscription using
https://<your-domain>/instagram
as the callback URL.
- Refer to Threads' Webhooks Documentation and set up Threads Webhooks product as a sub use case under the Threads API main use case.
- Set up your webhooks callback URL as
https://<your-domain>/threads
.
POST /facebook
- Handles Facebook webhook events.
POST /instagram
- Handles Instagram webhook events.
POST /threads
- Handles Threads webhook events.
POST /whatsapp
- Handles WhatsApp webhook events.
POST /message
- Sends a WhatsApp message.
This project is licensed under the MIT License.