WAVE emits structured events throughout the streaming lifecycle. These events are available via webhooks, Inngest functions, and the real-time Supabase subscription.
CREATED → STARTING → LIVE → ENDING → ENDED
↘ ERROR ↗
interface StreamEvent {
event_id: string;
stream_id: string;
organization_id: string;
timestamp: string; // ISO 8601
type: StreamEventType;
}
type StreamEventType =
| "stream.created"
| "stream.starting"
| "stream.live"
| "stream.ending"
| "stream.ended"
| "stream.error"
| "stream.quality_changed"
| "stream.recording_ready";
interface QualityChangedEvent extends StreamEvent {
type: "stream.quality_changed";
data: {
previous: QualityProfile;
current: QualityProfile;
reason: "abr_adaptation" | "manual" | "bandwidth_constraint";
};
}
interface QualityProfile {
width: number;
height: number;
fps: number;
bitrate_kbps: number;
codec: "h264" | "h265" | "av1" | "vp9";
}
interface RecordingReadyEvent extends StreamEvent {
type: "stream.recording_ready";
data: {
recording_id: string;
duration_seconds: number;
size_bytes: number;
format: "mp4" | "mkv" | "ts";
playback_url: string;
download_url: string;
thumbnail_url: string;
};
}
interface ViewerEvent {
event_id: string;
stream_id: string;
viewer_id: string;
timestamp: string;
type: ViewerEventType;
}
type ViewerEventType =
| "viewer.joined"
| "viewer.left"
| "viewer.quality_switched"
| "viewer.buffering"
| "viewer.error";