This simple app demonstrates integration with the Zoom Realtime Media Streams SDK for Node.js.
The SDK is already included in package dependencies. Install other dependencies:
npm installCopy the example environment file and fill in your credentials:
cp .env.example .envSet your Zoom OAuth credentials:
ZM_RTMS_CLIENT=your_client_id
ZM_RTMS_SECRET=your_client_secretStart the application:
npm startFor webhook testing with ngrok:
ngrok http 8080Use the generated ngrok URL as your Zoom webhook endpoint. Then, start a meeting to see your data!
Here's how you can implement the SDK yourself.
ES Modules:
import rtms from "@zoom/rtms";CommonJS:
const rtms = require('@zoom/rtms').default;Create a client for each meeting to handle multiple concurrent meetings:
// Listen for Zoom webhook events
rtms.onWebhookEvent(({ event, payload }) => {
if (event === "meeting.rtms_started") {
const client = new rtms.Client();
// Configure callbacks
client.onAudioData((buffer, size, timestamp, metadata) => {
// Process audio data
});
// Join using webhook payload
client.join(payload);
}
});Configure audio, video, and deskshare processing parameters before joining:
client.setAudioParams({
contentType: rtms.AudioContentType.RAW_AUDIO,
codec: rtms.AudioCodec.OPUS,
sampleRate: rtms.AudioSampleRate.SR_16K,
channel: rtms.AudioChannel.STEREO,
dataOpt: rtms.AudioDataOption.AUDIO_MIXED_STREAM,
duration: 20, // 20ms frames
frameSize: 640 // 16kHz * 2 channels * 20ms
});client.setVideoParams({
contentType: rtms.VideoContentType.RAW_VIDEO,
codec: rtms.VideoCodec.H264,
resolution: rtms.VideoResolution.HD,
dataOpt: rtms.VideoDataOption.VIDEO_SINGLE_ACTIVE_STREAM,
fps: 30
});client.setDeskshareParams({
contentType: rtms.VideoContentType.RAW_VIDEO,
codec: rtms.VideoCodec.H264,
resolution: rtms.VideoResolution.FHD,
dataOpt: rtms.VideoDataOption.VIDEO_SINGLE_ACTIVE_STREAM,
fps: 15
});onJoinConfirm(reason)- ✅ Join confirmationonSessionUpdate(op, sessionInfo)- 🔄 Session state changesonUserUpdate(op, participantInfo)- 👥 Participant join/leaveonAudioData(buffer, size, timestamp, metadata)- 🎵 Audio dataonVideoData(buffer, size, timestamp, metadata)- 📹 Video dataonTranscriptData(buffer, size, timestamp, metadata)- 💬 Live transcriptiononLeave(reason)- 👋 Meeting ended
For complete parameter options and detailed documentation:
- 🎵 Audio Parameters - Complete audio configuration options
- 📹 Video Parameters - Complete video configuration options
- 🖥️ Deskshare Parameters - Complete deskshare configuration options
- 📖 Full API Documentation - Complete SDK reference