Node.js Kafka consumer dropping Genesys Streaming Analytics events after 24h

Could use a hand troubleshooting this Node.js consumer that stops processing Genesys Cloud Streaming Analytics events after roughly 24 hours.

The setup uses the @genesyscloud/streaming-sdk to connect to /api/v2/analytics/conversations/events and writes to a local Kafka topic.

const streaming = require('@genesyscloud/streaming-sdk');
const producer = new kafka.Producer();

streaming.connect({
 url: 'https://api.mypurecloud.com',
 clientId: process.env.CLIENT_ID,
 clientSecret: process.env.CLIENT_SECRET
}).then((client) => {
 client.on('event', (event) => {
 producer.send([{ topic: 'gc-analytics', messages: JSON.stringify(event) }], (err, data) => {
 if (err) console.error('Kafka send error:', err);
 });
 });
});

The consumer connects fine. Events flow for a day. Then, the WebSocket connection drops with a 401 Unauthorized error, despite the OAuth token refresh logic being in place. The token refresh endpoint /oauth/token returns a valid new token, but the streaming client does not seem to reconnect automatically with the new credentials.

Is there a specific lifecycle method I need to hook into for token rotation in the streaming SDK? I am referencing the Genesys Docs but they lack examples for long-running Node.js processes with automatic re-authentication.

Any pointers on handling the 401 reconnection gracefully?