@arcaelas/whatsapp¶

A TypeScript library for WhatsApp automation built on top of baileys v7. It ships a class-based core, pluggable persistence engines, and a Stage 3 decorator DSL for building bots — all without external API keys.
Features¶
- Class-based API: a single
WhatsApporchestrator withMessage,Chat, andContactdelegates. - Pluggable engines:
FileSystemEnginefor local development,RedisEnginefor production, or implement your ownEngine. - Decorator DSL: optional
@arcaelas/whatsapp/decoratorssub-entry with@Bot,@on,@guard,@command,@pipe,@every,@pair. - Full event system:
connected,disconnected,message:*,chat:*,contact:*— every listener receives(payload, chat, wa). - Identifier resolution: transparent normalization between phone numbers, JID (
@s.whatsapp.net), and LID (@lid). - Multi-account isolation: each
WhatsAppinstance owns its engine namespace, so multiple sessions can coexist in the same process.
Hello world¶
index.ts
import { WhatsApp, FileSystemEngine } from "@arcaelas/whatsapp";
import { writeFileSync } from "node:fs";
const wa = new WhatsApp({
engine: new FileSystemEngine(__dirname + "/.session"),
phone: 584144709840,
});
wa.on("connected", () => console.log("session ready"));
wa.on("message:created", (msg, chat) => console.log(chat.id, msg.caption));
await wa.connect((code) => {
if (typeof code === "string") console.log("PIN:", code);
else writeFileSync("qr.png", code);
});
Next steps¶
- Installation — install the package and configure the runtime.
- Getting Started — a guided tutorial from zero to a running bot.
- References — the full API surface of every class and option.