LiveKit JS Server SDK - v2.14.2
    Preparing search index...

    Class AgentDispatchClient

    Client to access Agent APIs

    Hierarchy

    • ServiceBase
      • AgentDispatchClient
    Index

    Constructors

    • Parameters

      • host: string

        hostname including protocol. i.e. 'https://.livekit.cloud'

      • OptionalapiKey: string

        API Key, can be set in env var LIVEKIT_API_KEY

      • Optionalsecret: string

        API Secret, can be set in env var LIVEKIT_API_SECRET

      • Optionaloptions: ClientOptions

        client options

      Returns AgentDispatchClient

    Methods

    • Create an explicit dispatch for an agent to join a room. To use explicit dispatch, your agent must be registered with an agentName.

      Parameters

      • roomName: string

        name of the room to dispatch to

      • agentName: string

        name of the agent to dispatch

      • Optionaloptions: CreateDispatchOptions

        optional metadata to send along with the dispatch

      Returns Promise<AgentDispatch>

      the dispatch that was created

    • Delete an explicit dispatch for an agent in a room.

      Parameters

      • dispatchId: string

        id of the dispatch to delete

      • roomName: string

        name of the room the dispatch is for

      Returns Promise<void>

    • Get an Agent dispatch by ID

      Parameters

      • dispatchId: string

        id of the dispatch to get

      • roomName: string

        name of the room the dispatch is for

      Returns Promise<undefined | AgentDispatch>

      the dispatch that was found, or undefined if not found