Table of Contents
Features
- Easy to use — Chat Bridge is designed to be easy to use, with a simple API that allows you to get started quickly.
- Fast — Chat Bridge is built on top of undici, a fast HTTP/1.1 client, and fastify, a fast web framework for Node.js.
- Powerful — Chat Bridge supports all the features of the Messenger Platform, including quick replies, postbacks, and more.
- Open source — Chat Bridge is open source, and is licensed under the MIT License.
Installation
Ready to get started? Install Chat Bridge using npm:
npm install chat-bridge
⚠️ Warning: Chat Bridge is currently in alpha, and is not yet ready for production use. We recommend that you do not use it in production until it reaches a stable release.
Usage
const { Client } = require("chat-bridge");
const client = new Client({
accessToken: 'YOUR_ACCESS_TOKEN',
verifyToken: 'YOUR_VERIFY_TOKEN'
});
client.on("message", (event) => {
const { sender, message } = event;
client.sendTextMessage(sender.id, `You wrote: ${message.text}`);
});
client.start(async () => {
console.log(`Listening on ${client.page.name} (${client.page.id})`);
});
Documentation
You can read additional documents at Chat Bridge
Contributing
We welcome contributions!
Fixing a bug, adding a new feature, or improving the documentation — we're always happy to see your work.
Read up on our contributing guidelines and then check out one of our issues.
Acknowledgments
- fastify — Fast and low overhead web framework, for Node.js
- undici — HTTP/1.1 client, written from scratch for Node.js
License
Chat Bridge is licensed under the MIT License unless otherwise specified.