Node.js WebSocket reconnection loop with Genesys Notification API

Building a Node.js listener for the Notification API. The connection drops randomly, and my reconnect logic creates a tight loop of 429 errors. I’m using ws and passing the Authorization header. Here’s the snippet:

ws.on('close', () => {
 setTimeout(() => new WebSocket(url, opts), 1000);
});

Should I be implementing exponential backoff manually, or is there a standard pattern for handling these drops in Node?