Skip to content

Shard

A shard created within a Conduit.

Constructors

new Shard()

1
new Shard(conduit: Conduit, data: ConduitShardData & object): Shard

Builds up a Shard.

Parameters

ParameterTypeDescription
conduitConduitThe Conduit that created this shard.
dataConduitShardData & objectThe data from the API. If the shard is of type ‘webhook’, it aditionally includes the secret which is not returned by the API.

Returns

Shard

Source

twitchfy/packages/eventsub/src/structures/Shard.ts:49

Properties

PropertyModifierTypeDescription
callback?readonlystringThe callback of the shard. Only present in webhook type.
conduitreadonlyConduitThe Conduit that created this shard.
idreadonlystringThe id of the shard. Starting from 0.
secret?readonlystringThe secret of the shard. Only present in webhook type.
sessionId?readonlystringThe session id of the shard. Only present in websocket type.
statusreadonlystringThe status of the shard. Probably ‘enabled’.
typereadonly"websocket" | "webhook"The type of transport of the shard.

Methods

delete()

1
delete(): Promise<Shard[]>

Deletes the shard.

Returns

Promise<Shard[]>

Source

twitchfy/packages/eventsub/src/structures/Shard.ts:86


toAPI()

1
toAPI(): object

Converts the shard to the API format.

Returns

object

The shard into API format.

MemberTypeValue
idstring
transportobject
transport.callbackstring
transport.method"websocket" | "webhook"
transport.secretstring
transport.session_idstring

Source

twitchfy/packages/eventsub/src/structures/Shard.ts:70