> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced

> Advanced SDK features including connection management, real-time listeners, login listeners, and WebSocket configuration.

<Accordion title="AI Integration Quick Reference">
  ```javascript theme={null}
  // Check connection status
  CometChat.getConnectionStatus(); // "connected" | "connecting" | "disconnected"

  // Listen for connection changes
  CometChat.addConnectionListener("LISTENER_ID", new CometChat.ConnectionListener({
    onConnected: () => console.log("Connected"),
    onDisconnected: () => console.log("Disconnected")
  }));

  // Listen for login events
  CometChat.addLoginListener("LISTENER_ID", new CometChat.LoginListener({
    loginSuccess: (user) => console.log("Logged in:", user),
    logoutSuccess: () => console.log("Logged out")
  }));
  ```
</Accordion>

This section helps you to know about the Connection Listeners.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Connection Status" icon="signal" href="/sdk/javascript/connection-status">
    Monitor and respond to connection state changes
  </Card>

  <Card title="WebSocket Management" icon="plug" href="/sdk/javascript/managing-web-sockets-connections-manually">
    Manually manage WebSocket connections
  </Card>

  <Card title="Login Listener" icon="right-to-bracket" href="/sdk/javascript/authentication-overview#login-listener">
    Listen for login and logout events
  </Card>

  <Card title="All Real-Time Listeners" icon="tower-broadcast" href="/sdk/javascript/all-real-time-listeners">
    Complete reference for all SDK listeners
  </Card>
</CardGroup>
