This library is experimental. Signaling works, but media relay (actual audio/video) requires a native DTLS addon or WebRTC bridge.
Installation
npm install meowcaller-js
Requires Node.js 17+ and Baileys.
Quick Start
import { makeWASocket, useMultiFileAuthState } from '@whiskeysockets/baileys';
import { Client, SinkFunc, SourceFunc } from 'meowcaller-js';
const { state, saveCreds } = await useMultiFileAuthState('auth_info');
const wa = makeWASocket({ auth: state, printQRInTerminal: true });
const client = new Client(wa);
client.Connect();
client.OnIncomingCall((call) => {
call.OnStateChange((phase) => console.log('phase:', phase.description));
call.OnEnd((reason) => console.log('ended:', reason));
call.Receive(SinkFunc((frame) => console.log('audio frame', frame.length)));
call.Play(SourceFunc(async () => null));
call.Answer();
});
Why meowcaller-js?
No CGO
Pure JavaScript throughout. No native bindings, no Go runtime. Just Node.js.
Async/Await
Modern async patterns instead of goroutines and channels.
EventEmitter
Standard EventEmitter patterns for call events. Familiar to any Node developer.
Baileys Native
Wraps directly around a Baileys socket. Drop into any existing project.
Implementation Status
| Feature | Status |
|---|---|
| Outbound calls | Signal path ported |
| Inbound calls | Signal path ported |
| Audio calls | Signaling done, media relay needs DTLS |
| Video calls | Signaling + depacketizer ported |
| MLow codec | Stub — needs WASM port |
| Opus codec | Planned |
| DTLS → relay | Needs native addon or WebRTC |
API Overview
Client
new Client(wa, opts?)— wrap a connected Baileys socketclient.Connect()— install call event handlersclient.Call(ctx, target)— place an outbound callclient.OnIncomingCall(fn)— handle inbound offersclient.ListCalls()/client.GetCall(id)— inspect live calls
Call
call.Answer()/call.Reject()/call.Hangup()call.Play(source)/call.Receive(sink)— pipe audiocall.OnStateChange(fn)/call.OnEnd(fn)— lifecycle events
Audio & Video
SourceFunc(provider)— wrap a frame generator as an audio sourceSinkFunc(fn)— callback-based audio sinkPCMStream(readable)— raw s16le PCM to float32 framesWAVFile(path)— stream a WAV file as audio