Reference
JavaScript SDK
ws-transport

@cubejs-client/ws-transport

WebSocket transport for Cube client

WebSocketTransport

constructor

new WebSocketTransport(__namedParameters: object): WebSocketTransport

apiUrl

apiUrl: string

hearBeatInterval

hearBeatInterval: number

messageCounter

messageCounter: number

messageIdToSubscription

messageIdToSubscription: Record‹number, Subscription

messageQueue

messageQueue: Message[]

token

token: string

ws

ws: any

authorization

initSocket

initSocket(): any

request

request(method: string, __namedParameters: object): object

sendMessage

protected sendMessage(message: any): void

WebSocketTransportResult

constructor

new WebSocketTransportResult(__namedParameters: object): WebSocketTransportResult

result

result: unknown

status

status: unknown

json

json(): Promise‹unknown›

Types

Message

NameType
messageIdnumber
methodstring
paramsstring
requestIdany

Subscription

NameType
callback(result: WebSocketTransportResult) => void
messageMessage

WebSocketTransportOptions

NameType
apiUrlstring
authorizationstring
hearBeatInterval?number
heartBeatInterval?number