Node.js consumer dropping events from Genesys /api/v2/analytics/events/stream

We’ve got a Node.js service running in our staging environment that subscribes to the Genesys Cloud streaming analytics endpoint /api/v2/analytics/events/stream. The goal is to pipe these WebSocket events directly into a Kafka topic for downstream processing.

The connection establishes fine using the ws library, and we get the initial subscription acknowledgment. But after about 30 seconds of inactivity on the chat side, the Node process stops receiving new events. It’s not disconnecting, just silent. We’re handling the on('message') event and parsing the JSON payload, but nothing comes through for conversation:participant:wrapup events specifically.

Here’s the basic subscription setup:

const ws = new WebSocket(`wss://api.mypurecloud.com/api/v2/analytics/events/stream`, {
 headers: { 'Authorization': `Bearer ${accessToken}` }
});

ws.on('open', () => {
 ws.send(JSON.stringify({
 type: 'subscribe',
 filter: {
 eventTypes: ['conversation:participant:wrapup'],
 orgId: 'our-org-id'
 }
 }));
});

We’ve checked the token expiry and it’s valid for another hour. The Authorization header is correct. We’re also seeing no HTTP 401 or 403 errors in the logs, just dead air on the socket.

  • Node.js v18.17.0
  • ws library v8.14.2
  • Genesys Cloud org ID: our-org-id
  • Tested with curl to verify the token works for REST calls

Has anyone seen this behavior with the streaming events API? Is there a heartbeat or ping requirement we’re missing in the WebSocket implementation?