Skip to content

Class: AdsService ​

Twitch ad schedule, actions, and real-time ad break events.

Constructors ​

Constructor ​

ts
new AdsService(): AdsService;

Returns ​

AdsService

Methods ​

getSchedule() ​

ts
getSchedule(): Promise<AdScheduleStatus>;

Returns the current ad schedule, cached briefly by Kappapps.

Returns ​

Promise<AdScheduleStatus>


onBegin() ​

ts
onBegin(callback): void;

Registers a callback fired when a manual or automatic ad break begins.

Parameters ​

callback ​

OnAdBreakBeginCallback

Returns ​

void


snooze() ​

ts
snooze(): Promise<AdSnoozeResult>;

Pushes the next automatic mid-roll ad back by five minutes.

Returns ​

Promise<AdSnoozeResult>


start() ​

ts
start(length): Promise<AdStartResult>;

Starts a commercial break with one of Twitch's supported durations.

Parameters ​

length ​

AdStartLength

Returns ​

Promise<AdStartResult>