Client configuration passed to the underlying FCA bot.
Account-level API for authentication session operations.
Message-level API for sending, replying, reacting, and editing messages.
Thread management API.
Handles participants, metadata updates, polls, and group operations.
User-related API for profiles and social graph queries.
Creates a ConduitMessageCollector backed by the internal typed event bus.
Collectors receive fully enriched Conduit payloads, not raw FCA events.
The payload type is automatically derived as a union of all event payloads
in the events array.
Configuration for the collector.
A running ConduitMessageCollector instance.
Manually emits a Conduit event, running it through both the internal event bus and the full middleware stack. Useful for synthetic events
The Conduit event name to emit.
The fully formed payload to dispatch.
Authenticates with Messenger and initializes the FCA client.
Must be called before using any API or event system.
Authentication method (appstate, cookies, or email/password).
The same client instance for chaining.
Registers middleware for a Conduit event.
Middleware executes sequentially and must call next() to continue
the chain. Multiple middlewares can be registered per event.
The Conduit event name to listen for.
Ordered middleware stack to register.
Registers middleware on raw FCA events, bypassing the Conduit enrichment layer entirely.
Useful for unsupported or experimental FCA events not yet mapped to Conduit event names.
Raw FCA event name.
Ordered middleware stack to register.
Waits for a single matching message and resolves with it.
Internally creates a ConduitMessageCollector with max: 1 and
resolves on the first collected payload, or rejects on timeout.
OptionaleventsOrOptions: K | Omit<CollectorOptions<K>, "max"> & { default?: D }Optionaloptions: Omit<CollectorOptions<K>, "max"> & { default?: D }Collector options minus max, which is forced to 1.
Pass default to resolve with a fallback value on timeout instead of throwing.
A promise resolving with the first matching payload, or the default value on timeout.
// Throws on timeout
const reply = await client.waitResponse({
timeout: 15_000,
filter: (msg) => msg.senderID === expectedID,
});
// Resolves with null on timeout — no try/catch needed
const reply = await client.waitResponse({
timeout: 15_000,
filter: (msg) => msg.senderID === expectedID,
default: null,
});
if (!reply) return ctx.send("you took too long!");
High-level Messenger client built on top of the FCA unofficial API.
Provides:
All FCA events are funneled through dedicated FCA event bindings, normalized, enriched with helper methods, then dispatched onto both the middleware stack and the internal typed event bus.
Example