npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fca-eryxenx

v1.0.0

Published

Facebook Chat API - Modified by EryXenX | Stable, Auto Re-login, Fixed setMessageReaction

Readme

💬 fca-eryxenx

Unofficial Facebook Chat API for Node.js - Fork of @dongdev/fca-unofficial with bug fixes and improvements

FeaturesInstallationQuick StartDocumentation


⚡ Why fca-eryxenx?

  • setMessageReaction — threadID is now optional (backward compatible with all GoatBot commands)
  • ✅ Fixed group message handling (parseDelta fix)
  • ✅ Stable session management
  • ✅ Based on @dongdev/fca-unofficial v3.0.31

✨ Features

  • Full Messenger API - Send messages, files, stickers, and more
  • Real-time Events - Listen to messages, reactions, and thread events
  • AppState Support - Save login state to avoid re-authentication
  • MQTT Protocol - Real-time messaging via MQTT
  • TypeScript Support - Includes TypeScript definitions

📦 Installation

npm install fca-eryxenx

Requirements:

  • Node.js >= 12.0.0
  • Active Facebook account

🚀 Quick Start

1️⃣ Login and Simple Echo Bot

const login = require("fca-eryxenx");

login({ appState: [] }, (err, api) => {
  if (err) return console.error(err);

  api.listenMqtt((err, event) => {
    if (err) return console.error(err);
    if (event.type === "message") {
      api.sendMessage(event.body, event.threadID);
    }
  });
});

2️⃣ Send Text Message

const login = require("fca-eryxenx");

login({ appState: [] }, (err, api) => {
  if (err) return console.error("Login Error:", err);

  const yourID = "000000000000000";
  api.sendMessage("Hey! 👋", yourID, (err) => {
    if (err) console.error(err);
    else console.log("✅ Message sent!");
  });
});

3️⃣ Send File/Image

const login = require("fca-eryxenx");
const fs = require("fs");

login({ appState: [] }, (err, api) => {
  if (err) return console.error(err);

  const msg = {
    body: "Check this out! 📷",
    attachment: fs.createReadStream(__dirname + "/image.jpg"),
  };
  api.sendMessage(msg, "000000000000000");
});

📝 Message Types

| Type | Usage | Example | | --- | --- | --- | | Regular text | { body: "message" } | { body: "Hello!" } | | Sticker | { sticker: "sticker_id" } | { sticker: "369239263222822" } | | File/Image | { attachment: fs.createReadStream(path) } | { attachment: fs.createReadStream("image.jpg") } | | URL | { url: "https://example.com" } | { url: "https://github.com" } | | Large emoji | { emoji: "👍", emojiSize: "large" } | { emoji: "👍", emojiSize: "large" } |


💾 AppState Management

Save AppState

const fs = require("fs");
const login = require("fca-eryxenx");

login({ email: "YOUR_EMAIL", password: "YOUR_PASSWORD" }, (err, api) => {
  if (err) return console.error(err);
  fs.writeFileSync("appstate.json", JSON.stringify(api.getAppState(), null, 2));
  console.log("✅ AppState saved!");
});

Use Saved AppState

const fs = require("fs");
const login = require("fca-eryxenx");

login(
  { appState: JSON.parse(fs.readFileSync("appstate.json", "utf8")) },
  (err, api) => {
    if (err) return console.error(err);
    console.log("✅ Logged in!");
  }
);

🔄 Auto Login

Create fca-config.json in your project root:

{
  "autoLogin": true,
  "apiServer": "https://minhdong.site",
  "apiKey": "",
  "credentials": {
    "email": "YOUR_EMAIL_OR_PHONE",
    "password": "YOUR_PASSWORD",
    "twofactor": ""
  }
}

👂 Listening for Messages

const fs = require("fs");
const login = require("fca-eryxenx");

login(
  { appState: JSON.parse(fs.readFileSync("appstate.json", "utf8")) },
  (err, api) => {
    if (err) return console.error(err);

    api.setOptions({ listenEvents: true });

    api.listenMqtt((err, event) => {
      if (err) return console.error(err);

      switch (event.type) {
        case "message":
          api.sendMessage(`🤖 BOT: ${event.body}`, event.threadID);
          break;
        case "event":
          console.log("📢 Event:", event);
          break;
      }
    });
  }
);

🎯 API Quick Reference

📨 Messaging

sendMessage, sendTypingIndicator, getMessage, editMessage, deleteMessage, unsendMessage, setMessageReaction, forwardAttachment, uploadAttachment, createPoll

📬 Read Receipt

markAsRead, markAsReadAll, markAsDelivered, markAsSeen

👥 Thread Management

getThreadInfo, getThreadList, getThreadHistory, deleteThread, changeThreadColor, changeThreadEmoji, changeGroupImage, setTitle, changeNickname

👤 User & Group

getUserInfo, getFriendsList, getCurrentUserID, createNewGroup, addUserToGroup, removeUserFromGroup, changeAdminStatus

🔐 Auth & Listening

logout, getAppState, setOptions, listenMqtt


📄 License

MIT License — see LICENSE-MIT

Original by DongDev • Modified by EryXenX


Made with ❤️ by EryXenX