Node.js Notification API WebSocket reconnecting but missing events

I’m trying to keep a persistent connection to the Genesys Cloud Notification API using Node.js. The initial handshake works fine with the bearer token, but when the server drops the connection (usually after an hour), my reconnect logic fires and establishes a new WebSocket. The problem is I lose all events that happened during that gap, and I don’t want to miss anything.

I’ve tried using the lastEventId header in the reconnect request, but the server still sends me the full history from the start of the subscription window, not just the missed ones. Am I sending the header wrong? Here is the relevant snippet:

ws.on('close', () => {
 console.log('Connection closed. Reconnecting...');
 const newWs = new WebSocket('wss://api.eu-gb.genesiscloud.com/v2/analytics/events/realtime', {
 headers: {
 'Authorization': `Bearer ${token}`,
 'Last-Event-ID': lastEventId // This is populated from the last 'id' field received
 }
 });
 setupListeners(newWs);
});

The docs say this should work, but it feels like I’m getting a replay instead of a resume.