We’re trying to replace the default web widget with a custom UI for a specific client channel. The goal is to use the Guest API directly to manage the conversation lifecycle without the overhead of the full SDK widget.
I’m establishing the WebSocket connection to the guest endpoint. The initial handshake works fine, and I get a 101 Switching Protocols response. I send the authentication message with the auth_token retrieved from the REST API.
The problem is the connection closes right after. I’m getting a 1000 Close code with no reason phrase. I’ve checked the token validity; it works perfectly when I use it to fetch conversation data via REST.
Here’s the payload I’m sending on the socket:
{
"type": "auth",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
I’ve tried adding a region field to the auth message, but that didn’t change anything. The connection just drops. Is there a specific sequence of messages required after auth, or am I missing a header in the WebSocket upgrade request? The docs are pretty sparse on the raw socket implementation details.