@zoom/rtms
    Preparing search index...

    Function onWebhookEvent

    • Sets up a webhook server to receive events from Zoom

      This function creates an HTTP or HTTPS server that listens for webhook events from Zoom. When a webhook event is received, it parses the JSON payload and passes it to the provided callback function.

      For secure HTTPS connections, provide the following environment variables:

      • ZM_RTMS_CERT: Path to SSL certificate file
      • ZM_RTMS_KEY: Path to SSL certificate key file
      • ZM_RTMS_CA_WEBHOOK: (Optional) Path to CA certificate for client verification

      Parameters

      • callback: WebhookCallback

        Function to call when webhook events are received

      Returns void

      import rtms from '@zoom/rtms';

      // Set up the webhook listener (uses HTTPS if certificates are provided)
      rtms.onWebhookEvent(({event, payload}) => {
      if (event === "meeting.rtms.started") {
      console.log(`RTMS started for meeting: ${payload.meeting_uuid}`);

      // Create a dedicated client for this meeting
      const client = new rtms.Client();

      // Set up callbacks
      client.onAudioData((data, timestamp, metadata) => {
      console.log(`Received audio: ${data.length} bytes from ${metadata.userName}`);
      });

      // Join the meeting
      client.join(payload);
      }
      });