Skip to content

agent-playground / Exports / PlaygroundWebSocketClient

Class: PlaygroundWebSocketClient

Table of contents

Constructors

Methods

Constructors

constructor

new PlaygroundWebSocketClient(serverUrl, userId?, sessionId?, authToken?): PlaygroundWebSocketClient

Parameters

NameType
serverUrlstring
userId?string
sessionId?string
authToken?string

Returns

PlaygroundWebSocketClient

Defined in

agent-playground/src/lib/playground/websocket-client.ts:104

Methods

connect

connect(): Promise<boolean>

Connect to the WebSocket server

Returns

Promise<boolean>

Defined in

agent-playground/src/lib/playground/websocket-client.ts:114


disconnect

disconnect(): void

Disconnect from the WebSocket server

Returns

void

Defined in

agent-playground/src/lib/playground/websocket-client.ts:218


updateAuth

updateAuth(userId, sessionId, authToken): void

Update authentication credentials

Parameters

NameType
userIdstring
sessionIdstring
authTokenstring

Returns

void

Defined in

agent-playground/src/lib/playground/websocket-client.ts:258


sendMessage

sendMessage(message): boolean

Send a message through the WebSocket

Parameters

NameType
messageOmit<IPlaygroundWebSocketMessage, "timestamp">

Returns

boolean

Defined in

agent-playground/src/lib/playground/websocket-client.ts:272


broadcastUpdate

broadcastUpdate(data): boolean

Broadcast playground update

Parameters

NameType
dataTUniversalValue

Returns

boolean

Defined in

agent-playground/src/lib/playground/websocket-client.ts:297


on

on(event, handler): void

Add event listener

Parameters

NameType
eventstring
handlerTPlaygroundWebSocketEventHandler

Returns

void

Defined in

agent-playground/src/lib/playground/websocket-client.ts:309


off

off(event, handler): void

Remove event listener

Parameters

NameType
eventstring
handlerTPlaygroundWebSocketEventHandler

Returns

void

Defined in

agent-playground/src/lib/playground/websocket-client.ts:319


getStatus

getStatus(): IPlaygroundConnectionStatus

Get current connection status

Returns

IPlaygroundConnectionStatus

Defined in

agent-playground/src/lib/playground/websocket-client.ts:329

Released under the MIT License.