> ## Documentation Index
> Fetch the complete documentation index at: https://docs.navtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# conversation.connected.success

> WebSocket connection successful event

Triggered immediately after the WebSocket connection is successfully established. This event contains the session ID for tracking and the ICE server configuration needed for WebRTC connection setup.

## Event Properties

<ResponseField name="type" type="string">
  Event type. Always `"conversation.connected.success"` for this event.
</ResponseField>

<ResponseField name="data" type="object">
  Event data object containing connection information.
</ResponseField>

<ResponseField name="data.sessionId" type="string">
  The session ID for this connection. Use this for logging, billing, and backend correlation.

  **Example**: `"session-abc123"`
</ResponseField>

<ResponseField name="data.iceServers" type="array<object>">
  ICE server configuration for WebRTC connection. Use these servers when creating your RTCPeerConnection.

  **Example**:

  ```json theme={null}
  [
    {
      "urls": "stun:stun.l.google.com:19302"
    },
    {
      "urls": "turn:turn.example.com:3478",
      "username": "user",
      "credential": "pass"
    }
  ]
  ```
</ResponseField>

<ResponseExample>
  ```json Example theme={null}
  {
    "type": "conversation.connected.success",
    "data": {
      "sessionId": "session-abc123",
      "iceServers": [
        {
          "urls": "stun:stun.l.google.com:19302"
        }
      ]
    }
  }
  ```
</ResponseExample>

## Usage Example

```javascript theme={null}
const NavTalkMessageType = Object.freeze({
    CONNECTED_SUCCESS: "conversation.connected.success",
    // ... other event types
});

async function handleReceivedMessage(data) {
    const nav_data = data.data;
    
    switch (data.type) {
        case NavTalkMessageType.CONNECTED_SUCCESS:
            const sessionId = nav_data.sessionId;
            const iceServers = nav_data.iceServers;
            
            // Configure WebRTC with ICE servers
            const configuration = { iceServers: iceServers };
            peerConnection = new RTCPeerConnection(configuration);
            
            console.log("Connection successful, sessionId:", sessionId);
            break;
    }
}
```

<Note>
  This event is sent immediately upon successful WebSocket connection, before any session events. The ICE server configuration is provided directly, eliminating the need for a separate WebRTC signaling WebSocket connection.

  If there are any non-critical warnings (such as duplicate avatar names), a separate `conversation.connected.warning` event will be sent immediately after this event.
</Note>
