Socket
Socket
Sign inDemoInstall

chat-bridge

Package Overview
Dependencies
63
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chat-bridge

Chat Bridge simplifies the integration of Facebook Messenger webhook handling into your Node.js applications.


Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Chat Bridge

NPM Version NPM Downloads hits

Chat Bridge is an npm package that simplifies the integration of Facebook Messenger webhook handling into your Node.js applications. It offers a convenient way to interact with the Messenger Platform, handling incoming messages, postbacks, quick replies, and more.

| Installation | Features | Basic Usage | Documentation | Credits | License |

Installation

# Using npm
npm install @onyx/chat-bridge 
# or use your favorite package manager

Warning: This package is still in development and is not yet ready for production use.

Features

  • Easy Integration: Quickly integrate Facebook Messenger webhook handling into your Node.js applications with minimal setup.
  • Message Handling: Simplifies the handling of incoming messages, postbacks, quick replies, and more from the Messenger Platform.
  • Event-based Architecture: Utilizes an event-based architecture for handling different Messenger events, providing a clean and modular structure.

Basic Usage

const { Client } = require("@onyx/chat-bridge");

const client = new Client({
    accessToken: 'YOUR_ACCESS_TOKEN',
    verifyToken: 'YOUR_VERIFY_TOKEN',
});

client.on("message", (event) => {
    const { sender, message } = event;
    const { text } = message;
    const { id } = sender;

    client.sendTextMessage(id, `You wrote: ${text}`);
});

client.start(async () => console.log(`Listening on ${client.page.name} (${client.page.id})`)); // Start the server

For detailed documentation, please refer to the Documentation page.

Credits

  • Fastify - Fast and low overhead web framework, for Node.js
  • Undici - An HTTP/1.1 client, written from scratch for Node.js

License

This project is licensed under the MIT License - see the LICENSE file for details.


Keywords

FAQs

Last updated on 08 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc