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-nx

v6.6.6

Published

Facebook Messenger API for Node.js — Fast, Secure, and Feature-Rich

Readme

⚡ Lightning Fast · 🔒 Secure · 🌐 90+ Methods · 🛡️ Auto-Healing

FCA-NX is a modern Facebook Messenger API client for Node.js,
built for bots, automation systems, integrations, and advanced Messenger applications.



✨ Features

| Feature | Description | |:---:|---| | ⚡ Lightning Fast | Optimized MQTT communication engine | | 🔒 Security First | Session protection with automatic backups | | 🛡️ Auto-Healing | Automatic recovery from connection problems | | 🔄 Auto Reconnect | Automatically reconnect after disconnects | | 🌐 90+ Methods | Messages, users, threads, reactions and more | | 📡 Real-Time Events | Powerful MQTT event listener | | 💾 Auto Save | Automatic appState protection | | 📢 Broadcasting | Controlled multi-thread broadcasting | | 👥 Thread Tools | Complete group management utilities | | 👤 User Tools | User information and relationship APIs |

📦 Installation

npm install fca-nx

Requirements

  • Node.js >= 18.0.0 Check your Node.js version:
node -v

🚀 Quick Start

const { login } = require("fca-nx");
const appState = require("./account.json");

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

    console.log("╭─────────────────────────────╮");
    console.log("│     🚀 FCA-NX CONNECTED     │");
    console.log("╰─────────────────────────────╯");

    api.autoSaveSession("./account.json", {
      interval: 3 * 60 * 1000,
      backup: true
    });

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

      if (event.type === "message") {
        api.sendMessage(
          "🤖 I received: " + event.body,
          event.threadID
        );
      }
    });
  }
);

🔐 Session Protection

api.autoSaveSession("./account.json");

api.autoSaveSession("./account.json", {
  interval: 5 * 60 * 1000,
  debounce: 30 * 1000,
  backup: true,
  maxBackups: 5
});

api.saveSession();
api.restoreFromBackup();
api.stopAutoSave();

💬 Messaging

Send Message

api.sendMessage("Hello world!", threadID);

Send Attachment

const fs = require("fs");

api.sendMessage(
  {
    body: "Check this out!",
    attachment: fs.createReadStream("./photo.jpg")
  },
  threadID
);

Mentions

api.sendMessage(
  {
    body: "Hey @John, how are you?",
    mentions: [
      {
        id: "123456789",
        tag: "@John",
        fromIndex: 4
      }
    ]
  },
  threadID
);

Sticker

api.sendMessage(
  {
    sticker: "369239263222822"
  },
  threadID
);

Location

api.sendMessage(
  {
    location: {
      latitude: 23.8103,
      longitude: 90.4125,
      current: true
    }
  },
  threadID
);

📡 Mass Broadcasting

const result = await api.sendBroadcast(
  "📢 Important announcement!",
  [
    "thread_id_1",
    "thread_id_2",
    "thread_id_3"
  ],
  {
    parallel: 3,
    delay: 2000,
    onProgress: (sent, total) => {
      console.log(`📊 Progress: ${sent}/${total}`);
    }
  }
);

console.log(`✅ Sent: ${result.success}`);
console.log(`❌ Failed: ${result.failed}`);

👥 Thread Management

const info = await api.getThreadInfo(threadID);
const threads = await api.getThreadList(20);
const history = await api.getThreadHistory(threadID, 50);

const groupID = await api.createGroup("New Group", ["user1", "user2"]);

await api.addUserToGroup(userID, threadID);
await api.removeUserFromGroup(userID, threadID);

await api.setTitle("New Group Name", threadID);
await api.changeThreadColor("#0084FF", threadID);
await api.changeThreadEmoji("🔥", threadID);
await api.changeNickname("Captain", threadID, userID);
await api.changeGroupImage(fs.createReadStream("./group.png"), threadID);

await api.changeAdminStatus(threadID, userID, true);

await api.createPoll(
  "What's your favorite color?",
  threadID,
  {
    Red: false,
    Blue: false,
    Green: false
  }
);

👤 User Operations

const user = await api.getUserInfo(userID);
const userV2 = await api.getUserInfoV2(userID);
const users = await api.getUserID("John Doe");
const uid = await api.getUID("[https://facebook.com/username](https://facebook.com/username)");
const friends = await api.getFriendsList();
const avatar = await api.getAvatarUser(userID);

// Relationship Management
await api.sendFriendRequest(userID);
await api.handleFriendRequest(userID, true);
await api.changeBlockedStatus(userID, true);
await api.unfriend(userID);

🖼️ Profile Management

await api.changeAvatar(fs.createReadStream("./avatar.jpg"));
await api.changeCover(fs.createReadStream("./cover.jpg"));
await api.changeBio("Powered by FCA-NX");

😍 Reactions & Interactions

await api.setMessageReaction("❤️", messageID, threadID);
await api.setMessageReaction("", messageID); // Remove reaction
await api.reactToPost(postID, "😂");

await api.sendMessage("Nice message!", threadID, null, messageID); // Reply

🔧 Message Actions

await api.editMessage("Updated text", messageID);
await api.unsendMessage(messageID);
await api.deleteMessage([messageID1, messageID2]);
await api.forwardAttachment(attachmentID, [userID]);

const attachments = await api.uploadAttachment([
  fs.createReadStream("./file.pdf")
]);

await api.markAsRead(threadID);
await api.markAsReadAll();
await api.sendTypingIndicator(threadID, true);

🌐 HTTP Utilities

// GET
api.httpGet("[https://api.example.com](https://api.example.com)", { param: "value" }, (err, data) => {
  console.log(data);
});

// POST
api.httpPost("[https://api.example.com](https://api.example.com)", { key: "value" }, (err, data) => {
  console.log(data);
});

// Form Data
api.httpPostFormData("[https://api.example.com](https://api.example.com)", { file: fs.createReadStream("./file.jpg") }, (err, data) => {
  console.log(data);
});

⚙️ Configuration

| Option | Type | Default | Description | |---|---|---|---| | selfListen | boolean | false | Receive own messages | | listenEvents | boolean | true | Receive thread events | | listenTyping | boolean | false | Receive typing events | | updatePresence | boolean | false | Receive online status | | autoMarkDelivery | boolean | false | Auto mark delivered | | autoMarkRead | boolean | false | Auto mark read | | autoReconnect | boolean | true | Auto reconnect | | online | boolean | false | Appear online | | proxy | string | null | HTTP proxy | | userAgent | string | null | Custom User-Agent | | emitReady | boolean | false | Emit ready event |

🔑 Login Methods

AppState

const { login } = require("fca-nx");
const appState = require("./account.json");

login({ appState }, options, callback);

Email & Password

login(
  {
    email: "[email protected]",
    password: "your_password"
  },
  options,
  callback
);

Email/password authentication may require additional verification.

🧩 API Architecture

api
│
├── messages
│   ├── send
│   ├── edit
│   ├── delete
│   ├── unsend
│   ├── react
│   └── uploadAttachment
│
├── threads
│   ├── createGroup
│   ├── getInfo
│   ├── getList
│   ├── addUsers
│   ├── removeUser
│   ├── setTitle
│   └── setNickname
│
├── users
│   ├── getID
│   ├── getInfo
│   ├── getInfoV2
│   └── getFriends
│
├── account
│   ├── changeAvatar
│   ├── changeCover
│   ├── changeBio
│   ├── handleFriendRequest
│   ├── changeBlockedStatus
│   └── logout
│
└── realtime
    ├── listen
    ├── stop
    └── middleware

🏗️ Architecture

┌─────────────────────┐
│     Your Bot / App  │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│       FCA-NX        │
├─────────────────────┤
│    API Layer        │
│    MQTT Engine      │
│    Session Manager  │
│    Auto Healing     │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│  Facebook Services  │
│                     │
└─────────────────────┘

🛡️ Best Practices

  1. Always use AppState
  2. Enable automatic session backups
  3. Use listenMqtt for real-time events
  4. Handle connection errors properly
  5. Use controlled broadcasting
  6. Keep session files private
  7. Never publish account credentials
  8. Keep FCA-NX updated

🤝 Contributing

git clone [https://github.com/xalmandevv/fca-nx.git](https://github.com/xalmandevv/fca-nx.git)
cd fca-nx
git checkout -b feature/amazing
git add .
git commit -m "Add amazing feature"
git push origin feature/amazing

Then open a Pull Request.

📄 License

MIT License — Free to use, modify, and distribute.