WebSocket reconnection logic for Genesys Notification API in Node.js

Just noticed that my Node.js script handling Genesys Notification WebSocket events drops subscriptions after a gateway timeout. I need robust reconnection logic that preserves the subscription state.

  1. Connect to wss://api.genesys.cloud/v2/analytics/events/notifications
  2. Subscribe to routing.queue.events
  3. Wait for 408 timeout
  4. Attempt reconnect with existing auth token

The subscriptions vanish on reconnect. How do I persist them without re-registering?