Function useChat

  • The useChat hook provides chat functionality for a LiveKit room. It returns a simple send function to send chat messages and an array of chatMessages to hold received messages. It also returns a update function that allows you to implement message-edit functionality.

    Remarks

    It is possible to pass configurations for custom message encoding and decoding and non-default topics on which to send the messages.

    Parameters

    • Optional options: ChatOptions

    Returns { chatMessages: ReceivedChatMessage[]; isSending: boolean; send: ((message: string) => Promise<ChatMessage>) | undefined; update: ((message: string, messageId: string) => Promise<ChatMessage>) | undefined }

    • chatMessages: ReceivedChatMessage[]
    • isSending: boolean
    • send: ((message: string) => Promise<ChatMessage>) | undefined
    • update: ((message: string, messageId: string) => Promise<ChatMessage>) | undefined

Generated using TypeDoc