Skip to content

WebSocketShard

A WebSocket Shard created within a Conduit.

Constructors

new WebSocketShard()

1
new WebSocketShard(options?: Pick<WebSocketConnectionOptions, "proxy">): WebSocketShard

Builds up a WebSocketShard.

Parameters

ParameterTypeDescription
options?Pick<WebSocketConnectionOptions, "proxy">The options for the WebSocketShard.

Returns

WebSocketShard

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:58

Properties

PropertyModifierTypeDefault valueDescription
proxyreadonlystringundefinedThe proxy used for the WebSocket connection if it was specified.
wspublicWebSocketShardConnectornullThe WebSocket connector for this shard.

Accessors

conduitId

1
get conduitId(): string

The id of the Conduit which created this shard.

Returns

string

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:81


helixClient

1
get helixClient(): HelixClient

The HelixClient to interact with the Twitch API of this shard.

Returns

HelixClient

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:89


sessionId

1
get sessionId(): string

The session id of the shard.

1
set sessionId(value: string): void

Sets the session id of the shard.

Parameters

ParameterType
valuestring

Returns

string

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:67


shardId

1
get shardId(): string

The id of the shard.

Returns

string

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:96

Methods

connect()

1
connect(): Promise<void>

Connects the shard to the WebSocket connection. The Promise resolves when the connection is established and the session_welcome message was received.

Returns

Promise<void>

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:103


makeDebug()

1
makeDebug(...args: any[]): void

Sends a debug message to the parent thread.

Parameters

ParameterTypeDescription
argsany[]The arguments to send.

Returns

void

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:122


sendPacket()

1
sendPacket(packet: object): void

Sends a packet to the parent thread.

Parameters

ParameterTypeDescription
packetobjectThe packet to send.

Returns

void

Source

twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:130