aura-fca
v6.0.7
Published
Masterpiece Facebook Chat API client for Messenger automation, real-time MQTT listening, and session-stable Facebook chat operations.
Maintainers
Readme
MetaChat is a CommonJS library for Facebook Messenger automation. It combines session-aware authentication, real-time MQTT events, and practical messaging APIs in one focused client.
Install
npm install aura-fcaQuick start
Keep your exported browser session outside the repository.
const { login } = require("aura-fca");
const api = await login({
appState: require("./appstate.json"),
listenEvents: true,
autoReconnect: true,
autoReLogin: false,
});
api.listenMqtt(async (error, event) => {
if (error) throw error;
if (event?.type !== "message") return;
await api.sendMessage(`Echo: ${event.body}`, event.threadID);
});Built for
- Real-time message events through MQTT
- Text, attachments, stickers, replies, mentions, and locations
- Thread, user, reaction, typing, and read-state operations
- Session recovery, reconnects, rate limiting, and request validation
- CommonJS and TypeScript consumers
Core API
api.sendMessage(message, threadID);
api.listenMqtt(callback);
api.getThreadInfo(threadID);
api.getUserInfo(userID);
api.sendTypingIndicator(true, threadID);
api.logout();Security
Never commit appstate.json, cookies, passwords, or access tokens. Load session data from a secure secret store or a file excluded from version control.
License
MIT © MahMUD
