sahu-fca
v12.0.1
Published
Unofficial Facebook Chat API for Node.js with enhancements by SHAHADAT SAHU
Maintainers
Readme
🚀 SAHU-FCA: Unofficial Facebook Chat API
A lightweight, fast, and unofficial API to interact with Facebook Chat programmatically — ideal for building bots, automation systems, and custom messaging tools.
This project is customized and enhanced for improved performance and stability.
Customized by SHAHADAT SAHU
FCA Enhanced by Sheikh Tamim
✨ Features
- MQTT message listening and sending
- Automatic MQTT reconnection
- Text, reply, attachment, reaction, edit and unsend support
- Improved DM and group detection
OldMessagefallback- Experimental button messages
- Optional End-to-End Encryption (E2EE)
- E2EE messages, reactions, edits, unsend, typing and media
- Clean SAHU-FCA connection output
- No automatic package update or forced restart
📦 Installation
npm install sahu-fca@latest🚀 Basic Usage
const fs = require("fs");
const login = require("sahu-fca");
const appState = JSON.parse(
fs.readFileSync("appstate.json", "utf8")
);
login({ appState }, { listenEvents: true }, (err, api) => {
if (err) return console.error(err);
const listener = api.listenMqtt((listenErr, event) => {
if (listenErr) return console.error(listenErr);
if (event.type !== "message" || !event.body) return;
if (event.body.toLowerCase() === "/stop") {
listener.stopListening();
return;
}
api.sendMessage(`Echo: ${event.body}`, event.threadID);
});
});📤 Send a Message
api.sendMessage("Hello!", threadID, callback);Send an attachment:
api.sendMessage(
{
body: "Photo",
attachment: fs.createReadStream("./photo.jpg")
},
threadID,
callback
);🔐 E2EE
E2EE requires:
e2ee.js
lib/index.mjs
build/messagix.so (Linux x64)
build/messagix.dll (Windows x64)Enable it in the bot project's root config.json:
{
"e2ee": {
"enable": true,
"saveType": "memory"
}
}Native E2EE binaries are currently included for Linux x64 and Windows x64 only.
🔗 Links
📄 License
MIT — original source credits are preserved in the source files and license.
⚠️ Disclaimer
Note: This is an unofficial Facebook API. Use at your own risk. This project is not affiliated with or endorsed by Meta / Facebook in any way.
🚀 DEVELOPMENT APPROACH
- 💻 Copy-paste techniques with customizations
- 🤝 Collaborative development with friends
- 🤖 AI-powered using AI and other advanced tools
