Guest WebSocket API disconnects immediately after session start in custom chat UI

We are building a custom chat interface to replace the standard Genesys Cloud widget. The goal is to have full control over the UI styling and to embed the chat directly into our custom agent desktop application for a unified view. We are using the WebSocket-based Guest API as described in the developer documentation instead of the iframe widget.

The connection logic looks standard. We fetch the guest token from our backend, then initialize the WebSocket connection using the genesyscloud-guest-sdk package. The code snippet for the connection setup is below:

import { GuestClient } from '@genesyscloud/guest-sdk';

const client = new GuestClient({
 guestToken: token,
 onMessage: (message) => console.log('Received message', message),
 onConnectionStatus: (status) => console.log('Status:', status)
});

client.connect();

The connection establishes successfully for about 2 seconds. The onConnectionStatus callback fires with CONNECTED. However, immediately after, it fires DISCONNECTED with a close code of 1006. No error message is provided in the callback. The chat session never fully initializes, so we cannot send messages.

We have verified that the guest token is valid by using it in the REST API to create a chat interaction. The token works there. The issue seems specific to the WebSocket handshake or the initial keep-alive sequence. We are running this in a Node.js environment for testing, but the plan is to move it to the browser.

Is there a specific configuration required for the GuestClient to maintain the connection? We have tried increasing the timeout values, but it does not help. The logs show the socket opens, sends a hello frame, and then closes without a proper close frame from the server. We are unsure if we are missing a step in the initialization process or if there is a known issue with the SDK version we are using. Any insights into the expected WebSocket lifecycle for the Guest API would be appreciated.