Use this reference when you know which call or event you need and want its exact types.
The script guides explain grants, errors and practical use; Widgets, actions and templates explains widget setup and event handling.
Scripts run synchronously inside the bot and use nnz; widgets run in the browser and use NomNomz, whose remote calls return promises.
In the declarations below, ? means a property or argument can be omitted, null is an explicit empty result, and A | B allows either type.
Time values whose names end in Ms use milliseconds; date-time values are strings.
Types describe accepted shapes, while the linked guides explain limits, permissions and failure handling.
An action field marked optional can still depend on context, such as the viewer who triggered the run.
For declarations generated by your installed bot, use the SDK discovery endpoints. They also provide trigger-specific variables and widget-specific settings; those vary with the selected trigger or widget. Widget payload fields here follow the generated TypeScript snapshot shipped with the dashboard. The separate source-validation command compares that complete snapshot, including nested DTO fields, with freshly built C# reflection output; the standalone documentation build does not run that comparison. Serialization tests also check representative host results, but do not cover every runtime value or provider response. Use the installed bot’s declarations and catalog when checking a different build’s wire schema. Maintainers can find the comparison and regeneration steps in the documentation repository README.
Script calls and result types
These interfaces describe the objects under nnz.api, the grant-free helper namespaces and their result values.
The namespace names show which calls belong together: for example, NnzApiStorageNamespace describes nnz.api.storage.
They do not install an event bus in the script sandbox.
Use Script basics for the primitive bot facade, arguments and pipeline variables.
NnzApiUser
interface NnzApiUser {
id: string;
username: string;
displayName: string;
avatarUrl?: string;
paint?: NnzApiPaint;
}
NnzApiPaint
interface NnzApiPaint {
backgroundImage?: string;
color?: string;
textShadow?: string;
isImageOnly: boolean;
}
NnzApiTrack
interface NnzApiTrack {
track: string;
artist: string;
album: string | null;
durationMs: number;
progressMs: number;
isPlaying: boolean;
requestedBy: string | null;
provider: string;
}
NnzApiTtsResult
interface NnzApiTtsResult {
voiceId: string;
characterCount: number;
durationMs: number;
}
NnzApiTtsSegment
interface NnzApiTtsSegment {
text: string;
voice?: string;
rate?: number;
pitch?: number;
breakAfterMs?: number;
volume?: number;
stress?: boolean;
}
NnzApiTtsPause
interface NnzApiTtsPause {
pause: number;
}
NnzApiReward
interface NnzApiReward {
id: string;
title: string;
cost: number;
prompt: string | null;
isEnabled: boolean;
isPaused: boolean;
}
NnzApiRewardPatch
interface NnzApiRewardPatch {
title?: string;
cost?: number;
prompt?: string;
isEnabled?: boolean;
isPaused?: boolean;
}
NnzApiViewerStats
interface NnzApiViewerStats {
messages: number;
watchtimeSeconds: number;
firstSeen: string | null;
redemptions: number;
songRequests: number;
commands: number;
}
NnzApiTtsVoice
interface NnzApiTtsVoice {
voiceId: string;
displayName: string;
}
NnzApiTwitchUser
interface NnzApiTwitchUser {
id: string;
login: string;
displayName: string;
}
NnzApiTtsVoiceOption
interface NnzApiTtsVoiceOption {
voiceId: string;
displayName: string;
locale: string;
gender: string;
}
NnzUnits
interface NnzUnits {
convert(value: number, from: string, to: string): number;
}
NnzTime
interface NnzTime {
now(): string;
parse(iso: string): number;
format(epochMs: number): string;
add(iso: string, ms: number): string;
diff(a: string, b: string): number;
sleep(ms: number): void;
}
NnzMath
interface NnzMath {
clamp(value: number, min: number, max: number): number;
round(value: number, digits?: number): number;
lerp(a: number, b: number, t: number): number;
sum(values: number[]): number;
avg(values: number[]): number;
min(values: number[]): number;
max(values: number[]): number;
randomInt(min: number, max: number): number;
}
NnzStr
interface NnzStr {
padStart(value: string, length: number, pad?: string): string;
padEnd(value: string, length: number, pad?: string): string;
trim(value: string): string;
upper(value: string): string;
lower(value: string): string;
title(value: string): string;
truncate(value: string, length: number, ellipsis?: string): string;
slugify(value: string): string;
format(template: string, values: Record<string, unknown>): string;
}
NnzJson
interface NnzJson {
parse(text: string): unknown;
stringify(value: unknown): string;
}
NnzTemplate
interface NnzTemplate {
render(template: string, values?: Record<string, string | number | boolean>): string;
}
NnzRandom
interface NnzRandom {
int(min: number, max: number): number;
pick<T>(items: readonly T[]): T;
shuffle<T>(items: readonly T[]): T[];
uuid(): string;
}
NnzApiUserNamespace
interface NnzApiUserNamespace {
get(id?: string): NnzApiUser | null;
lookup(login: string): NnzApiTwitchUser | null;
}
NnzApiEconomyNamespace
interface NnzApiEconomyNamespace {
balance(userId?: string): number;
}
NnzApiChatNamespace
interface NnzApiChatNamespace {
send(text: string): void;
reply(text: string): void;
}
NnzApiMusicNamespace
interface NnzApiMusicNamespace {
nowPlaying(): NnzApiTrack | null;
queue(uri: string): boolean;
playNow(uri: string): boolean;
}
NnzApiHttpNamespace
interface NnzApiHttpNamespace {
fetch(url: string): string | null;
}
NnzApiStorageNamespace
interface NnzApiStorageNamespace {
get(key: string): string | null;
set(key: string, value: string): boolean;
delete(key: string): boolean;
list(prefix?: string): string[];
}
NnzApiTtsNamespace
interface NnzApiTtsNamespace {
speak(text: string, voiceId?: string, ratePercent?: number, pitchPercent?: number, asUser?: string): NnzApiTtsResult | null;
speakSequence(segments: (NnzApiTtsSegment | NnzApiTtsPause)[]): NnzApiTtsResult | null;
getVoice(userIdOrLogin?: string): NnzApiTtsVoice | null;
setVoice(userIdOrLogin: string, voiceId?: string): boolean;
listVoices(provider?: string, locale?: string): NnzApiTtsVoiceOption[];
}
NnzApiStatsNamespace
interface NnzApiStatsNamespace {
viewer(userIdOrLogin?: string): NnzApiViewerStats;
stream<K extends NnzStreamMetricKey>(options: NnzStreamStatsOptions<K>): NnzStreamStats<K> | null;
}
NnzApiWidgetNamespace
interface NnzApiWidgetNamespace {
emit(widgetIdOrName: string, eventType: string, data?: unknown): boolean;
}
NnzApiRewardNamespace
interface NnzApiRewardNamespace {
get(rewardIdOrTitle: string): NnzApiReward | null;
update(rewardIdOrTitle: string, patch: NnzApiRewardPatch): boolean;
}
NnzApiScheduleNamespace
interface NnzApiScheduleNamespace {
pipeline(pipelineName: string, delaySeconds: number, variables?: Record<string, string>, dedupeKey?: string): boolean;
}
NnzApiError
interface NnzApiError {
code: 'invalid_argument' | 'not_found' | 'refused' | 'rate_limited' | 'limit_exceeded' | 'upstream_failed';
message: string;
}
NnzApiActionResult
interface NnzApiActionResult {
success: boolean;
output: string | null;
error: string | null;
variables: Record<string, string>;
}
NnzApiActionsNamespace
interface NnzApiActionsNamespace {
invoke<T extends keyof NnzActionParams>(actionType: T, params: NnzActionParams[T], variables?: Record<string, string | number>): NnzApiActionResult;
invoke<T extends NnzActionsWithOptionalParams>(actionType: T, params?: NnzActionParams[T], variables?: Record<string, string | number>): NnzApiActionResult;
}
NnzApi
interface NnzApi {
actions: NnzApiActionsNamespace;
user: NnzApiUserNamespace;
economy: NnzApiEconomyNamespace;
chat: NnzApiChatNamespace;
music: NnzApiMusicNamespace;
http: NnzApiHttpNamespace;
storage: NnzApiStorageNamespace;
tts: NnzApiTtsNamespace;
stats: NnzApiStatsNamespace;
widget: NnzApiWidgetNamespace;
reward: NnzApiRewardNamespace;
schedule: NnzApiScheduleNamespace;
}
nnz
declare const nnz: {
readonly lastError: NnzApiError | null;
units: NnzUnits;
time: NnzTime;
math: NnzMath;
str: NnzStr;
json: NnzJson;
random: NnzRandom;
template: NnzTemplate;
api: NnzApi;
};
Widget calls and result types
NomNomz implements NnzOverlaySdk.
The callback event names map to the payload types below.
Catch rejected remote-call promises; an action result with success: false is a resolved refusal or failure, rather than a rejected transport promise.
Both on and onAny receive metadata at runtime, but the current typed onAny tuple declares only the event name and payload.
Use an event-specific on handler when you need the declared meta argument, including replay and test flags.
NnzOverlaySdk
interface NnzOverlaySdk {
on<K extends keyof NnzWidgetEventMap>(eventType: K, handler: (data: NnzWidgetEventMap[K], eventType: K, meta?: NnzEventMeta) => void): NnzOverlaySdk;
on(eventType: `custom.${string}`, handler: (data: NnzCustomDataWidgetPayload, eventType: string, meta?: NnzEventMeta) => void): NnzOverlaySdk;
on(eventType: string, handler: (data: unknown, eventType: string, meta?: NnzEventMeta) => void): NnzOverlaySdk;
off<K extends keyof NnzWidgetEventMap>(eventType: K, handler: (data: NnzWidgetEventMap[K], eventType: K, meta?: NnzEventMeta) => void): NnzOverlaySdk;
off(eventType: `custom.${string}`, handler: (data: NnzCustomDataWidgetPayload, eventType: string, meta?: NnzEventMeta) => void): NnzOverlaySdk;
off(eventType: string, handler: (data: unknown, eventType: string, meta?: NnzEventMeta) => void): NnzOverlaySdk;
onAny(handler: (...event: NnzWidgetAnyEvent) => void): NnzOverlaySdk;
onSettings(handler: (settings: Record<string, unknown>) => void): NnzOverlaySdk;
reportError(message: string): void;
reportYouTubePlayerState(videoId: string, state: string, positionMs: number): Promise<boolean>;
reportMediaSharePlayerState(requestId: string | null, state: string, positionSeconds: number, durationSeconds: number, volume: number): Promise<boolean>;
readonly settings: Record<string, unknown>;
readonly actions: NnzOverlayActions;
readonly data: NnzOverlayData;
readonly spotify: NnzOverlaySpotify;
readonly template: NnzOverlayTemplate;
readonly widget: NnzOverlayWidget;
}
NnzEventMeta
interface NnzEventMeta {
replay: boolean;
occurredAt?: string;
test?: boolean;
}
NnzOverlayActions
interface NnzOverlayActions {
invoke<T extends keyof NnzActionParams>(actionType: T, params: NnzActionParams[T], variables?: Record<string, string | number>): Promise<NnzActionResult>;
invoke<T extends NnzActionsWithOptionalParams>(actionType: T, params?: NnzActionParams[T], variables?: Record<string, string | number>): Promise<NnzActionResult>;
claim(key: string): Promise<boolean>;
}
NnzActionResult
interface NnzActionResult {
success: boolean;
output: string | null;
error: string | null;
errorCode: string | null;
variables: Record<string, string>;
}
NnzOverlayData
interface NnzOverlayData {
nowPlaying(): Promise<NnzWidgetEventMap['music.nowPlaying'] | null>;
queue(): Promise<NnzMusicQueueItem[]>;
storage(key: string): Promise<string | null>;
streamStats<K extends NnzStreamMetricKey>(options: NnzStreamStatsOptions<K>): Promise<NnzStreamStats<K>>;
}
NnzMusicQueueItem
interface NnzMusicQueueItem {
trackName: string;
artist: string;
imageUrl: string | null;
durationMs: number;
requestedBy: string | null;
cost: number;
code: string;
inFlight: boolean;
}
NnzOverlaySpotify
interface NnzOverlaySpotify {
playbackToken(): Promise<{ token: string } | { error: 'blocked' | 'error' }>;
}
NnzOverlayTemplate
interface NnzOverlayTemplate {
render(template: string, values?: Record<string, string | number | boolean>): Promise<string>;
}
NnzOverlayWidget
interface NnzOverlayWidget {
readonly id: string;
readonly name: string;
}
Action parameters
Both nnz.api.actions.invoke and NomNomz.actions.invoke use this parameter map.
NnzActionParams[T] is the parameter object in the row for action type T.
Pass the action type as the first argument and its parameter object as the second.
An action with no required fields permits the second argument to be omitted.
Scripts need the grant for the literal action type; widgets run through their channel owner’s permissions.
Run a pipeline action explains that distinction and how to read the result.
These are input declarations; a value returned at runtime is not automatically a declared variable in the pipeline editor.
The speech coordination example explains the extra declaration needed for scene.token in a saved pipeline.
| Action type | Parameters |
|---|---|
adjust_counter | key: string;delta?: number; |
adjust_viewer_data | key: string;delta?: number;target?: string; |
announce | message: string;color?: 'primary' | 'purple' | 'blue' | 'green' | 'orange'; |
ban | user_id?: string;reason?: string; |
break | No fields. |
cancel_live_game | No fields. |
check_balance | set_var?: string;min?: number; |
clear_viewer_data | key: string; |
continue | No fields. |
deduct_currency | amount: number;reason?: string; |
delete_message | message_id?: string; |
draw_giveaway | giveaway_id?: string; |
enter_giveaway | giveaway_id?: string; |
grant_currency | amount: number;reason?: string; |
jar_contribute | jar_id: string;amount: number; |
media_playback | command: 'play' | 'pause' | 'stop' | 'skip' | 'seek' | 'volume' | 'replay' | 'play_now';value?: string; |
music_add_to_playlist | playlistId: string;provider?: 'spotify' | 'youtube'; |
music_cycle_repeat | No fields. |
music_follow_artist | No fields. |
music_next | No fields. |
music_pause | No fields. |
music_play | No fields. |
music_play_pause | No fields. |
music_previous | No fields. |
music_remove_from_playlist | playlistId: string;provider?: 'spotify' | 'youtube'; |
music_save_track | No fields. |
music_seek | positionSeconds: number; |
music_set_repeat | mode: 'off' | 'track' | 'context'; |
music_set_shuffle | enabled: boolean; |
music_set_volume | volume: number; |
music_toggle_saved | No fields. |
music_toggle_shuffle | No fields. |
music_transfer_device | deviceId: string; |
music_unfollow_artist | No fields. |
music_unsave_track | No fields. |
music_volume_down | step?: number; |
music_volume_mute | unmuteVolume?: number; |
music_volume_up | step?: number; |
obs_call_vendor | vendor: string;request_type: string;request_data?: string; |
obs_filter | source: string;filter: string;enabled?: boolean; |
obs_hotkey | hotkey_name: string; |
obs_input_mute | input: string;muted?: boolean;toggle?: boolean; |
obs_input_volume | input: string;volume_db?: number;volume_mul?: number; |
obs_media | input: string;action?: 'play' | 'pause' | 'stop' | 'restart' | 'next' | 'previous'; |
obs_recording | action?: 'start' | 'stop' | 'toggle' | 'pause' | 'resume' | 'split'; |
obs_refresh_browser | input: string; |
obs_replay_buffer | action?: 'start' | 'stop' | 'toggle'; |
obs_request | request_type: string;request_data?: string; |
obs_request_batch | requests: string[];execution?: 'realtime' | 'frame' | 'parallel';halt_on_failure?: boolean; |
obs_save_replay | No fields. |
obs_screenshot | source: string;format?: 'png' | 'jpg' | 'jpeg'; |
obs_set_preview_scene | scene: string; |
obs_set_source | scene: string;source: string;visible?: boolean; |
obs_streaming | action?: 'start' | 'stop' | 'toggle'; |
obs_switch_scene | scene: string; |
obs_transition | transition?: string;studio?: boolean;duration_ms?: number; |
obs_virtual_cam | action?: 'start' | 'stop' | 'toggle'; |
open_giveaway | giveaway_id: string; |
permit | target_variable?: string;role_or_capability: string;duration_minutes?: number; |
pick_from_list | list: string;variable?: string; |
play_game | game_type: string;bet: number; |
play_sound | clip: string;volume?: number;wait_for_finish?: boolean;synced?: boolean;handle?: string; |
play_track_once | track_uri: string; |
play_tts | text?: string;segments?: string;voice?: string;as?: string;rate?: string;mode?: 'async' | 'sync';scene_token?: string; |
playlist_add | playlist_id: string;provider?: 'spotify' | 'youtube';track_uri?: string;message?: string;already_message?: string; |
post_quote | number?: string; |
redemption_fulfill | No fields. |
redemption_refund | No fields. |
require_tier | min_tier: 'free' | 'base' | 'pro' | 'premium';denied_message?: string; |
return_value | value?: string; |
run_code | code_script_id: string; |
run_pipeline | pipeline: string;mode?: 'inline' | 'detached';args?: string[];named_args?: Record<string, string>;wait?: boolean; |
scene_release | scene_token: string; |
scene_reserve | max_hold_seconds?: number; |
schedule_pipeline | pipeline?: string;command?: string;action_type?: string;action_params?: Record<string, string>;delay_seconds: number;dedupe_key?: string; |
send_discord_notification | trigger_type: 'go_live' | 'follow' | 'subscription' | 'gift_subscription' | 'cheer' | 'raid' | 'stream_end' | 'resubscription' | 'poll_end' | 'prediction_resolved';dedupe_key?: string; |
send_message | message: string;sender?: 'bot' | 'broadcaster';reply_target?: 'chat' | 'overlay' | 'both' | 'none';reply_html?: boolean; |
send_reply | message: string; |
send_webhook | endpoint: string;event_type?: string; |
send_whisper | recipient: string;message: string; |
set_counter | key: string;value: number; |
set_pronoun | username: string;pronoun: string; |
set_variable | name: string;value?: string; |
set_viewer_data | key: string;value?: string;target?: string; |
shoutout | user_id: string;cooldown_minutes?: number;global_cooldown_minutes?: number;tts?: boolean;priority?: boolean;template?: string; |
show_raid_recap | No fields. |
song_ban | reason?: string; |
song_clear_requester | requester: string; |
song_current | No fields. |
song_pause | No fields. |
song_previous | No fields. |
song_queue | max?: number; |
song_queue_close | No fields. |
song_queue_open | No fields. |
song_request | query: string; |
song_request_favorite | user_id?: string; |
song_resume | No fields. |
song_skip | No fields. |
song_volume | volume: number; |
song_wrong | No fields. |
stage_effect | preset: 'confetti' | 'flash' | 'run_across' | 'shake';text?: string;duration_ms?: number;intensity?: number;color?: string; |
start_live_game | game_type: string; |
start_raid | target: string;delay_seconds?: number;raid_window_seconds?: number; |
stop | No fields. |
stop_sound | handle?: string;all?: boolean; |
submit_media | url: string; |
timeout | user_id?: string;duration: number;reason?: string; |
tts_clear_voice | target_variable?: string; |
tts_set_voice | voice_id: string;target_variable?: string; |
tts_synthesize | text: string;voice?: string;rate?: number;pitch?: number;play_on_audio?: boolean; |
unpermit | target_variable?: string;role_or_capability?: string; |
unwhitelist | target_variable?: string; |
vts_color_tint | r: number;g: number;b: number;a?: number;art_mesh_tag?: string; |
vts_load_model | model: string; |
vts_move_model | x?: number;y?: number;rotation?: number;size?: number;time_seconds?: number;relative?: boolean; |
vts_request | request_type: string;payload_json?: string; |
vts_set_expression | expression: string;active?: boolean; |
vts_trigger_hotkey | hotkey: string; |
wait | milliseconds?: number;seconds?: number; |
wait_for_event | event_name: string;timeout_seconds?: number; |
wait_until_raid_fires | No fields. |
whitelist | target_variable?: string;standing: 'subscriber' | 'vip' | 'artist' | 'moderator'; |
widget_event | widget_id: string;event_type: string;data?: string; |
NnzActionsWithOptionalParams
type NnzActionsWithOptionalParams = {
[K in keyof NnzActionParams]: {} extends NnzActionParams[K] ? K : never;
}[keyof NnzActionParams];
Widget event names
Pass these case-sensitive names to NomNomz.on.
The payload interfaces define the value passed as the first callback argument; meta is a separate optional argument.
custom. followed by a custom source name carries NnzCustomDataWidgetPayload.
Game events use unions: inspect their kind before reading fields belonging to one particular frame.
| Event name | Payload type |
|---|---|
follow | NnzFollowAlertDto |
subscription | NnzSubscriptionAlertDto |
resub | NnzResubAlertDto |
gift | NnzGiftSubAlertDto |
cheer | NnzCheerAlertDto |
raid | NnzRaidAlertDto |
raid_recap.show | NnzStreamStatsDto |
ban | NnzModActionDto |
timeout | NnzModActionDto |
unban | NnzModActionDto |
ChatMessage | NnzDashboardChatMessageDto |
ChatCleared | NnzChatClearedDto |
MessageDeleted | NnzMessageDeletedDto |
UserMessagesCleared | NnzUserMessagesClearedDto |
ChatMessageEnriched | NnzChatMessageEnrichedWidgetPayload |
hype_train_begin | NnzHypeTrainBeganAlertDto |
hype_train_progress | NnzHypeTrainProgressAlertDto |
hype_train_end | NnzHypeTrainEndedAlertDto |
poll_begin | NnzPollBeganAlertDto |
poll_progress | NnzPollProgressAlertDto |
poll_end | NnzPollEndedAlertDto |
prediction_begin | NnzPredictionBeganAlertDto |
prediction_progress | NnzPredictionProgressAlertDto |
prediction_lock | NnzPredictionLockedAlertDto |
prediction_end | NnzPredictionEndedAlertDto |
reward_redeemed | NnzRewardRedeemedDto |
moderator_added | NnzRoleChangedAlertDto |
moderator_removed | NnzRoleChangedAlertDto |
vip_added | NnzRoleChangedAlertDto |
vip_removed | NnzRoleChangedAlertDto |
shoutout_sent | NnzShoutoutSentAlertDto |
shoutout_received | NnzShoutoutReceivedAlertDto |
sr_queue | NnzSrQueueWidgetPayload |
media_share_command | NnzMediaShareCommandWidgetPayload |
now_playing | NnzNowPlayingWidgetPayload |
music.nowPlaying | NnzNowPlayingShapeDto |
ad_schedule | NnzAdScheduleWidgetPayload |
ad_upcoming | NnzAdUpcomingWidgetPayload |
youtube.play | NnzYouTubePlayWidgetPayload |
youtube.pause | NnzYouTubeTransportWidgetPayload |
youtube.resume | NnzYouTubeTransportWidgetPayload |
youtube.stop | NnzYouTubeTransportWidgetPayload |
youtube.seek | NnzYouTubeSeekWidgetPayload |
youtube.volume | NnzYouTubeVolumeWidgetPayload |
track_saved_changed | NnzTrackSavedWidgetPayload |
tts_speak | NnzTtsSpeakWidgetPayload |
stage_effect | NnzStageEffectPayload |
goal | NnzGoalWidgetEventPayload |
count | NnzCountWidgetEventPayload |
supporter.tip | NnzSupporterAlertPayload |
supporter.membership | NnzSupporterAlertPayload |
supporter.merch | NnzSupporterAlertPayload |
supporter.charity | NnzSupporterAlertPayload |
voice_trigger | NnzVoiceTriggerWidgetEventPayload |
game.lobby | NnzGameRoundOpenFrame | NnzGameJoinFrame | NnzGameMultiplierFrame | NnzGameCashoutFrame | NnzGameDropFrame |
game.running | NnzGameRoundOpenFrame | NnzGameJoinFrame | NnzGameMultiplierFrame | NnzGameCashoutFrame | NnzGameDropFrame |
game.resolved | NnzGameResultsFrame | NnzGameCancelledFrame |
play_sound | NnzPlaySoundPayload |
stop_sound | NnzStopSoundPayload |
test | Record<string, unknown> |
NnzWidgetAnyEvent
type NnzWidgetAnyEvent =
| [eventType: 'follow', data: NnzFollowAlertDto]
| [eventType: 'subscription', data: NnzSubscriptionAlertDto]
| [eventType: 'resub', data: NnzResubAlertDto]
| [eventType: 'gift', data: NnzGiftSubAlertDto]
| [eventType: 'cheer', data: NnzCheerAlertDto]
| [eventType: 'raid', data: NnzRaidAlertDto]
| [eventType: 'raid_recap.show', data: NnzStreamStatsDto]
| [eventType: 'ban', data: NnzModActionDto]
| [eventType: 'timeout', data: NnzModActionDto]
| [eventType: 'unban', data: NnzModActionDto]
| [eventType: 'ChatMessage', data: NnzDashboardChatMessageDto]
| [eventType: 'ChatCleared', data: NnzChatClearedDto]
| [eventType: 'MessageDeleted', data: NnzMessageDeletedDto]
| [eventType: 'UserMessagesCleared', data: NnzUserMessagesClearedDto]
| [eventType: 'ChatMessageEnriched', data: NnzChatMessageEnrichedWidgetPayload]
| [eventType: 'hype_train_begin', data: NnzHypeTrainBeganAlertDto]
| [eventType: 'hype_train_progress', data: NnzHypeTrainProgressAlertDto]
| [eventType: 'hype_train_end', data: NnzHypeTrainEndedAlertDto]
| [eventType: 'poll_begin', data: NnzPollBeganAlertDto]
| [eventType: 'poll_progress', data: NnzPollProgressAlertDto]
| [eventType: 'poll_end', data: NnzPollEndedAlertDto]
| [eventType: 'prediction_begin', data: NnzPredictionBeganAlertDto]
| [eventType: 'prediction_progress', data: NnzPredictionProgressAlertDto]
| [eventType: 'prediction_lock', data: NnzPredictionLockedAlertDto]
| [eventType: 'prediction_end', data: NnzPredictionEndedAlertDto]
| [eventType: 'reward_redeemed', data: NnzRewardRedeemedDto]
| [eventType: 'moderator_added', data: NnzRoleChangedAlertDto]
| [eventType: 'moderator_removed', data: NnzRoleChangedAlertDto]
| [eventType: 'vip_added', data: NnzRoleChangedAlertDto]
| [eventType: 'vip_removed', data: NnzRoleChangedAlertDto]
| [eventType: 'shoutout_sent', data: NnzShoutoutSentAlertDto]
| [eventType: 'shoutout_received', data: NnzShoutoutReceivedAlertDto]
| [eventType: 'sr_queue', data: NnzSrQueueWidgetPayload]
| [eventType: 'media_share_command', data: NnzMediaShareCommandWidgetPayload]
| [eventType: 'now_playing', data: NnzNowPlayingWidgetPayload]
| [eventType: 'music.nowPlaying', data: NnzNowPlayingShapeDto]
| [eventType: 'ad_schedule', data: NnzAdScheduleWidgetPayload]
| [eventType: 'ad_upcoming', data: NnzAdUpcomingWidgetPayload]
| [eventType: 'youtube.play', data: NnzYouTubePlayWidgetPayload]
| [eventType: 'youtube.pause', data: NnzYouTubeTransportWidgetPayload]
| [eventType: 'youtube.resume', data: NnzYouTubeTransportWidgetPayload]
| [eventType: 'youtube.stop', data: NnzYouTubeTransportWidgetPayload]
| [eventType: 'youtube.seek', data: NnzYouTubeSeekWidgetPayload]
| [eventType: 'youtube.volume', data: NnzYouTubeVolumeWidgetPayload]
| [eventType: 'track_saved_changed', data: NnzTrackSavedWidgetPayload]
| [eventType: 'tts_speak', data: NnzTtsSpeakWidgetPayload]
| [eventType: 'stage_effect', data: NnzStageEffectPayload]
| [eventType: 'goal', data: NnzGoalWidgetEventPayload]
| [eventType: 'count', data: NnzCountWidgetEventPayload]
| [eventType: 'supporter.tip', data: NnzSupporterAlertPayload]
| [eventType: 'supporter.membership', data: NnzSupporterAlertPayload]
| [eventType: 'supporter.merch', data: NnzSupporterAlertPayload]
| [eventType: 'supporter.charity', data: NnzSupporterAlertPayload]
| [eventType: 'voice_trigger', data: NnzVoiceTriggerWidgetEventPayload]
| [eventType: 'game.lobby', data: NnzGameRoundOpenFrame | NnzGameJoinFrame | NnzGameMultiplierFrame | NnzGameCashoutFrame | NnzGameDropFrame]
| [eventType: 'game.running', data: NnzGameRoundOpenFrame | NnzGameJoinFrame | NnzGameMultiplierFrame | NnzGameCashoutFrame | NnzGameDropFrame]
| [eventType: 'game.resolved', data: NnzGameResultsFrame | NnzGameCancelledFrame]
| [eventType: 'play_sound', data: NnzPlaySoundPayload]
| [eventType: 'stop_sound', data: NnzStopSoundPayload]
| [eventType: 'test', data: Record<string, unknown>]
| [eventType: `custom.${string}`, data: NnzCustomDataWidgetPayload];
Payload fields and nested objects
Expand a payload type from the event table to see all of its fields and nested object types.
NnzEventMap wire names belong to the event catalog; widget subscriptions use the names in the table above.
NnzChatMessageReceived
interface NnzChatMessageReceived {
messageId: string;
provider: string;
twitchBroadcasterId: string;
userId: string;
userDisplayName: string;
userLogin: string;
message: string;
fragments: NnzChatMessageFragment[];
colorHex?: string | null;
messageType: string;
badges: NnzChatBadge[];
isSubscriber: boolean;
isVip: boolean;
isArtist: boolean;
isModerator: boolean;
isBroadcaster: boolean;
isYouTubeChannelVerified: boolean;
bits: number;
replyParentMessageId?: string | null;
replyThreadParentMessageId?: string | null;
replyParentMessageBody?: string | null;
replyParentUserName?: string | null;
replyParentUserLogin?: string | null;
replyThreadUserName?: string | null;
sourceChannelId?: string | null;
sourceChannelName?: string | null;
sourceBadges?: NnzChatBadge[] | null;
}
NnzChannelOffline
interface NnzChannelOffline {
provider: string;
broadcasterDisplayName: string;
streamDuration: string;
streamStartedAt?: string | null;
}
NnzChannelOnline
interface NnzChannelOnline {
provider: string;
broadcasterDisplayName: string;
streamTitle: string;
gameName: string;
startedAt: string;
}
NnzFollowAlertDto
interface NnzFollowAlertDto {
userId: string;
displayName: string;
login: string;
followedAt?: string | null;
avatarUrl?: string | null;
pronouns?: string | null;
communityStanding?: string | null;
user: string;
}
NnzSubscriptionAlertDto
interface NnzSubscriptionAlertDto {
userId: string;
displayName: string;
tier: string;
user: string;
}
NnzResubAlertDto
interface NnzResubAlertDto {
userId: string;
displayName: string;
tier: string;
months: number;
streak: number;
message?: string | null;
user: string;
}
NnzGiftSubAlertDto
interface NnzGiftSubAlertDto {
gifterId?: string | null;
gifterDisplayName: string;
tier: string;
count: number;
anonymous: boolean;
user: string;
amount: number;
}
NnzCheerAlertDto
interface NnzCheerAlertDto {
userId?: string | null;
displayName: string;
bits: number;
message: string;
anonymous: boolean;
imageUrl?: string | null;
user: string;
amount: number;
}
NnzRaidAlertDto
interface NnzRaidAlertDto {
fromUserId: string;
fromDisplayName: string;
fromLogin: string;
viewerCount: number;
user: string;
viewers: number;
}
NnzModActionDto
interface NnzModActionDto {
action: string;
moderatorId: string;
targetUserId: string;
reason?: string | null;
durationSeconds?: number | null;
targetDisplayName?: string | null;
targetAvatarUrl?: string | null;
targetPronouns?: string | null;
targetCommunityStanding?: string | null;
moderatorDisplayName?: string | null;
timestamp: string;
broadcasterId: string;
}
NnzDashboardChatMessageDto
interface NnzDashboardChatMessageDto {
id: string;
channelId: string;
userId: string;
displayName: string;
username: string;
message: string;
fragments: NnzChatFragmentDto[];
userType: string;
isSubscriber: boolean;
isVip: boolean;
isModerator: boolean;
isBroadcaster: boolean;
isCheer: boolean;
isCommand: boolean;
badges: NnzChatBadgeDto[];
bitsAmount: number;
color?: string | null;
messageType: string;
replyToMessageId?: string | null;
replyParentMessageBody?: string | null;
replyParentUserName?: string | null;
timestamp: string;
replyThreadParentMessageId?: string | null;
avatarUrl?: string | null;
pronouns?: string | null;
provider: string;
paint?: NnzChatPaintDto | null;
isArtist: boolean;
overlayLine?: NnzOverlayLineDto | null;
hints?: NnzChatHintsDto | null;
kind: string;
noticeType?: string | null;
systemText?: string | null;
announcementColor?: string | null;
sourceChannelId?: string | null;
sourceChannelName?: string | null;
subTier?: string | null;
cumulativeMonths?: number | null;
giftCount?: number | null;
raidViewerCount?: number | null;
recipientUserId?: string | null;
recipientDisplayName?: string | null;
heldStatus?: string | null;
removed?: string | null;
sourceBadges?: NnzChatBadgeDto[] | null;
sourceChannelAvatarUrl?: string | null;
}
NnzChatClearedDto
interface NnzChatClearedDto {
clearedByUserId: string;
}
NnzMessageDeletedDto
interface NnzMessageDeletedDto {
messageId: string;
deletedByUserId: string;
targetUserId: string;
deletedByDisplayName: string;
}
NnzUserMessagesClearedDto
interface NnzUserMessagesClearedDto {
targetUserId: string;
targetUserDisplayName: string;
targetUserLogin: string;
}
NnzChatMessageEnrichedWidgetPayload
interface NnzChatMessageEnrichedWidgetPayload {
messageId: string;
linkUrl?: string | null;
title?: string | null;
description?: string | null;
imageUrl?: string | null;
provider?: string | null;
userDisplayName?: string | null;
userLogin?: string | null;
}
NnzHypeTrainBeganAlertDto
interface NnzHypeTrainBeganAlertDto {
hypeTrainId: string;
level: number;
total: number;
progress: number;
goal: number;
topContributions: NnzHypeTrainContributionDto[];
expiresAt: string;
}
NnzHypeTrainProgressAlertDto
interface NnzHypeTrainProgressAlertDto {
hypeTrainId: string;
level: number;
total: number;
progress: number;
goal: number;
topContributions: NnzHypeTrainContributionDto[];
expiresAt: string;
}
NnzHypeTrainEndedAlertDto
interface NnzHypeTrainEndedAlertDto {
hypeTrainId: string;
level: number;
total: number;
topContributions: NnzHypeTrainContributionDto[];
endedAt: string;
}
NnzPollBeganAlertDto
interface NnzPollBeganAlertDto {
pollId: string;
title: string;
choices: NnzPollChoiceDto[];
durationSeconds: number;
endsAt: string;
}
NnzPollProgressAlertDto
interface NnzPollProgressAlertDto {
pollId: string;
title: string;
choices: NnzPollChoiceDto[];
endsAt: string;
}
NnzPollEndedAlertDto
interface NnzPollEndedAlertDto {
pollId: string;
title: string;
status: string;
choices: NnzPollChoiceDto[];
winningChoiceId?: string | null;
}
NnzPredictionBeganAlertDto
interface NnzPredictionBeganAlertDto {
predictionId: string;
title: string;
outcomes: NnzPredictionOutcomeDto[];
windowSeconds: number;
locksAt: string;
}
NnzPredictionProgressAlertDto
interface NnzPredictionProgressAlertDto {
predictionId: string;
title: string;
outcomes: NnzPredictionOutcomeDto[];
locksAt: string;
}
NnzPredictionLockedAlertDto
interface NnzPredictionLockedAlertDto {
predictionId: string;
title: string;
outcomes: NnzPredictionOutcomeDto[];
}
NnzPredictionEndedAlertDto
interface NnzPredictionEndedAlertDto {
predictionId: string;
title: string;
status: string;
outcomes: NnzPredictionOutcomeDto[];
winningOutcomeId?: string | null;
}
NnzRewardRedeemedDto
interface NnzRewardRedeemedDto {
broadcasterId: string;
rewardId: string;
rewardTitle: string;
redemptionId: string;
userId: string;
userDisplayName: string;
cost: number;
userInput?: string | null;
timestamp: string;
avatarUrl?: string | null;
pronouns?: string | null;
communityStanding?: string | null;
eventId?: string | null;
}
NnzRoleChangedAlertDto
interface NnzRoleChangedAlertDto {
userId: string;
userDisplayName: string;
userLogin: string;
avatarUrl?: string | null;
pronouns?: string | null;
communityStanding?: string | null;
}
NnzShoutoutSentAlertDto
interface NnzShoutoutSentAlertDto {
toUserId: string;
toDisplayName: string;
}
NnzShoutoutReceivedAlertDto
interface NnzShoutoutReceivedAlertDto {
fromBroadcasterId: string;
fromBroadcasterDisplayName: string;
fromBroadcasterLogin: string;
viewerCount: number;
avatarUrl?: string | null;
pronouns?: string | null;
communityStanding?: string | null;
}
NnzSrQueueWidgetPayload
interface NnzSrQueueWidgetPayload {
items: NnzSongRequestQueueSnapshotItem[];
}
NnzMediaShareCommandWidgetPayload
interface NnzMediaShareCommandWidgetPayload {
command: string;
requestId?: string | null;
sourceType?: string | null;
mediaRef?: string | null;
sourceUrl?: string | null;
title?: string | null;
durationSeconds?: number | null;
positionSeconds?: number | null;
volume?: number | null;
}
NnzNowPlayingWidgetPayload
interface NnzNowPlayingWidgetPayload {
isPlaying: boolean;
track?: string | null;
artist?: string | null;
artUrl?: string | null;
provider?: string | null;
trackUri?: string | null;
durationMs: number;
progressMs: number;
observedAt: string;
requestedBy?: string | null;
requestedByColor?: string | null;
}
NnzNowPlayingShapeDto
interface NnzNowPlayingShapeDto {
engine: string;
itemId?: string | null;
title: string;
artists: string[];
albumArtUrl?: string | null;
durationMs: number;
progressMs: number;
isPlaying: boolean;
requestedBy?: string | null;
volume: number;
muted: boolean;
state: string;
blockedReason?: string | null;
}
NnzAdScheduleWidgetPayload
interface NnzAdScheduleWidgetPayload {
nextAdAt?: string | null;
lastAdAt?: string | null;
durationSeconds: number;
prerollFreeTimeSeconds: number;
snoozeCount: number;
snoozeRefreshAt?: string | null;
timeUntilNextAdSeconds?: number | null;
}
NnzAdUpcomingWidgetPayload
interface NnzAdUpcomingWidgetPayload {
secondsUntilAd: number;
thresholdSeconds: number;
durationSeconds: number;
nextAdAt: string;
}
NnzYouTubePlayWidgetPayload
interface NnzYouTubePlayWidgetPayload {
videoId: string;
trackUri: string;
}
NnzYouTubeTransportWidgetPayload
interface NnzYouTubeTransportWidgetPayload {
}
NnzYouTubeSeekWidgetPayload
interface NnzYouTubeSeekWidgetPayload {
positionMs: number;
}
NnzYouTubeVolumeWidgetPayload
interface NnzYouTubeVolumeWidgetPayload {
percent: number;
}
NnzTrackSavedWidgetPayload
interface NnzTrackSavedWidgetPayload {
trackUri: string;
track?: string | null;
artist?: string | null;
isSaved: boolean;
}
NnzTtsSpeakWidgetPayload
interface NnzTtsSpeakWidgetPayload {
text: string;
voice: string;
user: string;
durationMs: number;
audioUrl?: string | null;
}
NnzStageEffectPayload
interface NnzStageEffectPayload {
preset: string;
text?: string | null;
durationMs: number;
intensity?: number | null;
color?: string | null;
}
NnzGoalWidgetEventPayload
interface NnzGoalWidgetEventPayload {
metric: string;
value: number;
target: number;
}
NnzCountWidgetEventPayload
interface NnzCountWidgetEventPayload {
metric: string;
value: number;
}
NnzSupporterAlertPayload
interface NnzSupporterAlertPayload {
kind: string;
supporterDisplayName: string;
amountMinor?: number | null;
currency?: string | null;
tier?: string | null;
quantity?: number | null;
messageText?: string | null;
isRecurring: boolean;
user: string;
amount?: number | null;
}
NnzVoiceTriggerWidgetEventPayload
interface NnzVoiceTriggerWidgetEventPayload {
word: string;
count: number;
stickerImageUrl?: string | null;
}
NnzGameRoundOpenFrame
interface NnzGameRoundOpenFrame {
kind: 'round_open';
lobbySeconds: number;
maxMultiplier?: number | null;
target?: number | null;
radius?: number | null;
successChance?: number | null;
}
NnzGameJoinFrame
interface NnzGameJoinFrame {
kind: 'join';
player: string;
stake: number;
entry?: number | null;
phase?: string | null;
crewSize?: number | null;
successChance?: number | null;
crew?: NnzGameRosterEntry[] | null;
pot?: number | null;
entrants?: NnzGameRosterEntry[] | null;
}
NnzGameMultiplierFrame
interface NnzGameMultiplierFrame {
kind: 'progress' | 'bust' | 'cap';
multiplier: number;
}
NnzGameCashoutFrame
interface NnzGameCashoutFrame {
kind: 'cashout';
player: string;
multiplier: number;
payout: number;
crewSize: number;
}
NnzGameDropFrame
interface NnzGameDropFrame {
kind: 'drop';
player: string;
landed: number;
distance: number;
hit: boolean;
score: number;
seed: string;
spawnX: number;
}
NnzGameResultsFrame
interface NnzGameResultsFrame {
kind: 'results';
results: NnzGameResultRow[];
crashedAt?: number | null;
capped?: boolean | null;
target?: number | null;
radius?: number | null;
successChance?: number | null;
crewSize?: number | null;
pot?: number | null;
winner?: string | null;
payout?: number | null;
}
NnzGameCancelledFrame
interface NnzGameCancelledFrame {
kind: 'cancelled';
cancelled: boolean;
reason: string;
}
NnzPlaySoundPayload
interface NnzPlaySoundPayload {
playbackUrl: string;
volume: number;
handle?: string | null;
synced: boolean;
}
NnzStopSoundPayload
interface NnzStopSoundPayload {
handle?: string | null;
all: boolean;
}
NnzCustomDataWidgetPayload
interface NnzCustomDataWidgetPayload {
fields: Record<string, string>;
}
NnzChatMessageFragment
interface NnzChatMessageFragment {
type: string;
text: string;
emoteId?: string | null;
emoteSetId?: string | null;
emoteOwnerId?: string | null;
emoteFormats: string[];
emote?: NnzChatEmote | null;
cheermotePrefix?: string | null;
cheermoteBits?: number | null;
cheermoteTier?: number | null;
cheermoteImage?: NnzCheermoteImage | null;
mentionUserId?: string | null;
mentionUserLogin?: string | null;
mentionUserName?: string | null;
mentionColorHex?: string | null;
linkUrl?: string | null;
linkPreview?: NnzLinkPreview | null;
gifId?: string | null;
gifUrl?: string | null;
}
NnzChatBadge
interface NnzChatBadge {
setId: string;
id: string;
info?: string | null;
isArtist: boolean;
}
NnzChatFragmentDto
interface NnzChatFragmentDto {
type: string;
text: string;
emote?: NnzChatEmoteDto | null;
cheermote?: NnzChatCheermoteDto | null;
mention?: NnzChatMentionDto | null;
linkUrl?: string | null;
linkPreview?: NnzChatLinkPreviewDto | null;
gif?: NnzChatGifDto | null;
}
NnzChatBadgeDto
interface NnzChatBadgeDto {
setId: string;
id: string;
info?: string | null;
urls: Record<string, string>;
}
NnzChatPaintDto
interface NnzChatPaintDto {
id: string;
name: string;
backgroundImage?: string | null;
color?: string | null;
textShadow?: string | null;
isImageOnly: boolean;
}
NnzOverlayLineDto
interface NnzOverlayLineDto {
requestedBy?: string | null;
highlight?: string | null;
size: string;
durationSeconds?: number | null;
}
NnzChatHintsDto
interface NnzChatHintsDto {
firstEver: boolean;
firstOfDay: boolean;
firstOfStream: boolean;
accountCreatedAt?: string | null;
}
NnzHypeTrainContributionDto
interface NnzHypeTrainContributionDto {
userId: string;
userLogin: string;
userDisplayName: string;
type: string;
total: number;
}
NnzPollChoiceDto
interface NnzPollChoiceDto {
id: string;
title: string;
votes: number;
channelPointsVotes: number;
}
NnzPredictionOutcomeDto
interface NnzPredictionOutcomeDto {
id: string;
title: string;
channelPoints: number;
users: number;
color: string;
}
NnzSongRequestQueueSnapshotItem
interface NnzSongRequestQueueSnapshotItem {
title: string;
requestedBy: string;
durationSec: number;
number: number;
code: string;
}
NnzGameRosterEntry
interface NnzGameRosterEntry {
player: string;
stake: number;
}
NnzGameResultRow
interface NnzGameResultRow {
player: string;
stake?: number | null;
cashedAt?: number | null;
landed?: number | null;
distance?: number | null;
score?: number | null;
won?: boolean | null;
escaped?: boolean | null;
payout: number;
}
NnzChatEmote
interface NnzChatEmote {
provider: 'Twitch' | 'Bttv' | 'Ffz' | 'SevenTv';
id: string;
code: string;
urls: Record<string, string>;
animated: boolean;
zeroWidth: boolean;
setId?: string | null;
ownerId?: string | null;
formats?: string[] | null;
type?: string | null;
tier?: number | null;
owner?: NnzChatEmoteOwner | null;
artist?: NnzChatEmoteOwner | null;
origin?: ('Own' | 'Channel' | 'Other' | 'Global') | null;
ownerChannel?: NnzChatEmoteOwner | null;
staticUrls?: Record<string, string> | null;
}
NnzCheermoteImage
interface NnzCheermoteImage {
urls: Record<string, string>;
animated: boolean;
colorHex: string;
}
NnzLinkPreview
interface NnzLinkPreview {
host: string;
title?: string | null;
description?: string | null;
imageUrl?: string | null;
}
NnzChatEmoteDto
interface NnzChatEmoteDto {
id: string;
setId?: string | null;
format: string;
provider: string;
urls: Record<string, string>;
animated: boolean;
zeroWidth: boolean;
code: string;
type?: string | null;
tier?: number | null;
owner?: NnzChatEmoteOwnerDto | null;
artist?: NnzChatEmoteOwnerDto | null;
staticUrls?: Record<string, string> | null;
}
NnzChatCheermoteDto
interface NnzChatCheermoteDto {
prefix: string;
bits: number;
tier: number;
urls?: Record<string, string> | null;
animated: boolean;
colorHex?: string | null;
}
NnzChatMentionDto
interface NnzChatMentionDto {
userId: string;
username: string;
displayName: string;
color?: string | null;
}
NnzChatLinkPreviewDto
interface NnzChatLinkPreviewDto {
host: string;
title?: string | null;
description?: string | null;
imageUrl?: string | null;
}
NnzChatGifDto
interface NnzChatGifDto {
gifId: string;
url: string;
}
NnzChatEmoteOwner
interface NnzChatEmoteOwner {
id?: string | null;
login?: string | null;
displayName?: string | null;
profileUrl?: string | null;
avatarUrl?: string | null;
}
NnzChatEmoteOwnerDto
interface NnzChatEmoteOwnerDto {
id?: string | null;
login?: string | null;
displayName?: string | null;
profileUrl?: string | null;
}
Stream metric types
These types are shared by nnz.api.stats.stream and NomNomz.data.streamStats.
The result always contains stream plus the metrics requested in metrics; an empty metrics list selects all metrics.
See Stream stats for collection windows, limits and data sources.
The generated declarations currently lose nullable reference annotations for metric result objects.
In particular, hypeTrain can be absent when no train ended, although NnzStreamMetricMap declares it without ?; channel is also omitted if its lookup returns no row.
Check those fields before reading their nested values.
The declarations below reproduce the emitted types; this limitation does not change the JSON response.
NnzStreamStatsDto
interface NnzStreamStatsDto {
stream: NnzStreamStatsWindowDto;
channel?: NnzStreamStatsChannelDto | null;
duration?: number | null;
peakViewers?: number | null;
followers?: number | null;
newFollowers?: string[] | null;
subs?: NnzStreamStatsSubsDto | null;
gifters?: NnzStreamStatsNamedCountDto[] | null;
selfSubs?: string[] | null;
bits?: NnzStreamStatsRankedDto | null;
raidsIn?: NnzStreamStatsRaidDto[] | null;
hypeTrain?: NnzStreamStatsHypeTrainDto | null;
redemptions?: NnzStreamStatsRankedDto | null;
songRequesters?: NnzStreamStatsRankedDto | null;
chat?: NnzStreamStatsChatDto | null;
topChatters?: NnzStreamStatsNamedCountDto[] | null;
commandsRun?: NnzStreamStatsRankedDto | null;
}
NnzStreamStatsWindowDto
interface NnzStreamStatsWindowDto {
id: string;
startedAt: string;
endedAt?: string | null;
title?: string | null;
game?: string | null;
}
NnzStreamStatsChannelDto
interface NnzStreamStatsChannelDto {
name: string;
avatarUrl?: string | null;
}
NnzStreamStatsSubsDto
interface NnzStreamStatsSubsDto {
new: number;
resub: number;
gift: number;
total: number;
}
NnzStreamStatsNamedCountDto
interface NnzStreamStatsNamedCountDto {
name: string;
count: number;
}
NnzStreamStatsRankedDto
interface NnzStreamStatsRankedDto {
total: number;
top: NnzStreamStatsNamedCountDto[];
}
NnzStreamStatsRaidDto
interface NnzStreamStatsRaidDto {
name: string;
viewers: number;
}
NnzStreamStatsHypeTrainDto
interface NnzStreamStatsHypeTrainDto {
level: number;
trains: number;
}
NnzStreamStatsChatDto
interface NnzStreamStatsChatDto {
messages: number;
uniqueChatters: number;
}
NnzStreamWindow
interface NnzStreamWindow {
id: string;
startedAt: string;
endedAt: string | null;
title: string | null;
game: string | null;
}
NnzStreamRanked
interface NnzStreamRanked {
total: number;
top: NnzStreamNamedCount[];
}
NnzStreamNamedCount
interface NnzStreamNamedCount {
name: string;
count: number;
}
NnzStreamChannel
interface NnzStreamChannel {
name: string;
avatarUrl: string | null;
}
NnzStreamChat
interface NnzStreamChat {
messages: number;
uniqueChatters: number;
}
NnzStreamHypeTrain
interface NnzStreamHypeTrain {
level: number;
trains: number;
}
NnzStreamRaid
interface NnzStreamRaid {
name: string;
viewers: number;
}
NnzStreamSubs
interface NnzStreamSubs {
new: number;
resub: number;
gift: number;
total: number;
}
NnzStreamMetricMap
interface NnzStreamMetricMap {
bits: NnzStreamRanked;
channel: NnzStreamChannel;
chat: NnzStreamChat;
commandsRun: NnzStreamRanked;
duration: number;
followers: number;
gifters: NnzStreamNamedCount[];
hypeTrain: NnzStreamHypeTrain;
newFollowers: string[];
peakViewers?: number;
raidsIn: NnzStreamRaid[];
redemptions: NnzStreamRanked;
selfSubs: string[];
songRequesters: NnzStreamRanked;
subs: NnzStreamSubs;
topChatters: NnzStreamNamedCount[];
}
NnzStreamMetricKey
type NnzStreamMetricKey = keyof NnzStreamMetricMap;
NnzStreamStats
type NnzStreamStats<K extends NnzStreamMetricKey> = Pick<NnzStreamMetricMap, K> & { stream: NnzStreamWindow };
NnzStreamStatsOptions
interface NnzStreamStatsOptions<K extends NnzStreamMetricKey> {
stream?: string;
metrics: readonly K[];
}
Declarations from your bot
The bot generates declarations from its own action, event and metric registries.
Use its dashboard API authentication and the sdk:read permission to request them from the bot’s backend URL:
| Request | Response |
|---|---|
GET /api/v1/sdk/types.d.ts?context=script | Plain-text TypeScript declarations for scripts. |
GET /api/v1/sdk/types.d.ts?context=widget | Plain-text TypeScript declarations for widgets. |
GET /api/v1/sdk/event-catalog?context=script | A JSON response with the script-visible event catalog in data. |
GET /api/v1/sdk/event-catalog?context=widget | A JSON response with the public event catalog in data. |
The context value is case-insensitive and defaults to script when absent or blank.
Another value returns HTTP 400.
Widgets see public catalog entries; scripts see public, moderator and broadcaster entries, with internal entries excluded.
The catalog’s wire names describe bot events; they are separate from the widget subscription names.
Each catalog item has wireName, tier, payloadSchema and samplePayloadJson, which is a JSON string or null.
A sample can be generated from the reflected shape when no translated fixture is available; it is not proof that a live provider emitted those values.
The types endpoint also accepts a narrower context:
| Query | Purpose |
|---|---|
context=script&trigger=command | Restricts bot.getVar suggestions to the variables a command trigger supplies. An event-response key can replace command. |
context=script&script=<script-guid> | Resolves the selected channel’s script triggers and combines their known variable keys. |
context=widget&widget=<widget-id> | Types the selected channel’s widget settings from its schema. |
Pass one of trigger, script or widget at a time.
A trigger or script applies only to script context, and a widget only to widget context; incompatible combinations return HTTP 400.
An unknown trigger returns HTTP 400; an unavailable script or widget returns HTTP 404.
A script without known usable trigger metadata keeps the general script declarations, and a widget without a usable settings schema keeps the general widget declarations.
This affects editor suggestions rather than adding capabilities to the running script or widget.