Socket
Socket
Sign inDemoInstall

chat-bridge

Package Overview
Dependencies
0
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
Install size
35.0 kB
Created
Weekly downloads
 

Changelog

Source

1.1.0-alpha

Minor Changes

We're excited to unveil a fresh update packed with improvements for smoother communication and development. Here's what's new:

Key Enhancements:
  • Streamlined Imports for Better Organization:
    • Types/interfaces now have a direct home at @/interfaces.
    • Import statements have been thoughtfully reordered for optimal clarity.
  • Unlocking Additional Communication Methods:
    • Send messages, attachments, images, audio, video, and files with ease using these new methods:
      • sendApiMessage
      • sendAttachment
      • sendImage
      • sendAudio
      • sendVideo
      • sendFile
  • Plugin Power Unleashed:
    • A new example demonstrates how to register plugins (like fastify-cors) using the register method, expanding customization possibilities.
  • Enhanced Error Handling for Clearer Insights:
    • Error messages in sendRequest now include the response body when requests fail, providing more actionable information for troubleshooting.
  • Minor Code Organization Tweaks for Smooth Sailing:
    • Import statements have been fine-tuned for enhanced code readability.
Code Structure Refinements:
  • Class Name Harmony: Collection in v1.0.0-alpha-alpha has evolved into Collections in v1.1.0-alpha.
  • File Organization Optimization:
    • Version 1.1.0-alpha introduces a more modular approach, with Collections defined and exported in a separate module alongside imported interfaces.
  • Interface Import Streamlining:
    • The Identifiable interface now resides in @/interfaces for consistent import across files.

Ready to experience these enhancements? Update to Chat Bridge v1.1.0-alpha today and unleash a more streamlined and versatile communication experience!

Readme

Source
Chat Bridge Logo

Chat Bridge

NPM Version NPM Downloads hits License Code of Conduct

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. 🚀

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

// Import the Client class
const { Client } = require("chat-bridge");

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

// Listen for incoming messages events
client.on("message", (event) => {
    const { sender, message } = event;

    // Send a text message back to the sender
    client.sendTextMessage(sender.id, `You wrote: ${message.text}`);
});

// Start the client
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.


Keywords

FAQs

Last updated on 12 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