Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Uhlive

Hierarchy

  • Uhlive

Index

Constructors

Events Methods

Other Methods

Constructors

constructor

  • Create an Uhlive instance by passing your private token and identifier.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");

    Parameters

    • identifier: string
    • token: string
    • Optional options: UhliveOptions

    Returns Uhlive

Events Methods

onClose

  • onClose(callback: (payload: any) => void): void
  • Subscribe to Uhlive onClose event.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.onClose((msg) => console.log(msg))

    Parameters

    • callback: (payload: any) => void
        • (payload: any): void
        • Parameters

          • payload: any

          Returns void

    Returns void

onError

  • onError(callback: (payload: any) => void): void
  • Subscribe to Uhlive onError event.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.onError((msg) => console.log(msg))

    Parameters

    • callback: (payload: any) => void
        • (payload: any): void
        • Parameters

          • payload: any

          Returns void

    Returns void

Other Methods

connect

  • Connect to the websocket.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.connect();

    Returns Uhlive

disconnect

  • Disconnect from the websocket.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.connect();
    // Do something...
    uhlive.disconnect();

    Returns Uhlive

join

  • Join a conversation.

    description

    Join a conversation and start recording immedialty. You can also join a conversation in read-only mode thanks to the options.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.connect();
    const myConversation = uhlive.join("my-conversation");
    // Do something with `myConversation`...
    uhlive.disconnect();

    Parameters

    • conversationId: ConversationId
    • Default value options: ConversationOptions = {interim_results: true,model: "default",readonly: false,rescoring: true,speaker: Uhlive.generateSpeakerId(),}

    Returns Conversation

leave

  • Leave a conversation.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.connect();
    const myConversation = uhlive.join("my-conversation");
    // Do something with `myConversation`...
    uhlive.leave("my-conversation");
    uhlive.disconnect();

    Parameters

    Returns boolean

leaveAllConversations

  • leaveAllConversations(): void
  • Leave all conversations at once.

    example
    const uhlive = new Uhlive("my-identifier", "my-token");
    uhlive.connect();
    const myConversation1 = uhlive.join("my-conversation1");
    const myConversation2 = uhlive.join("my-conversation2");
    // Do something with `myConversation1` and `myConversation12`...
    uhlive.leaveAllConversations();
    uhlive.disconnect();

    Returns void