Welcome to the Chat Functions section of our documentation! 📚 This guide covers advanced features and use cases for integrating chat functionality into your applications.

📌 Overview

Chat Functions provide a flexible way to handle real-time communication, including:

  • WebSocket support 🌐
  • Message routing 🧭
  • Custom event handlers ⚙️

For a deeper dive into WebSocket implementation, check out our WebSocket Guide.

🛠️ Available Functions

Here are the core functions available for chat integration:

  1. initChatSession()
    Initializes a new chat session with default settings.

    chat_session_init
  2. sendMessage(text, recipient)
    Sends a message to a specified recipient.

    message_sending
  3. onMessageReceived(callback)
    Registers a callback for handling incoming messages.

    message_callback
  4. setNotificationPreference(preferences)
    Configures notification settings for users.

    notification_settings

🧪 Usage Examples

// Example: Initialize chat session
initChatSession({ theme: "dark" });

// Example: Send a message
sendMessage("Hello, user!", "support@example.com");

// Example: Handle incoming messages
onMessageReceived((msg) => {
  console.log("New message:", msg);
});

For more details on advanced configurations, visit Chat Configuration Docs.

📝 Tips

  • Use Emoji to enhance user experience ✅
  • Always validate input data before processing 🔒
  • Refer to API Reference for full method details

Let us know if you need further assistance! 💬