subscribe

View as MarkdownOpen in Claude
1subscribe(eventType): Observable<Record<string, unknown>>

Subscribe to a custom signaling event type on this call.

Returns a cached observable that filters callSessionEvents$ for events whose event_type matches the given string. The observable completes when the call is destroyed.

Unlike signalingEvent$ (which only emits known call-level event types), this method also matches custom/user-defined event types.

The SDK does not validate event type strings --- the server decides whether a given type is valid.

Parameters

eventType
stringRequired

The event type to subscribe to (e.g. 'my.custom.event').

Returns

Observable<Record<string, unknown>>

An observable that emits matching signaling events.

Examples

1call.subscribe('my.custom.event').subscribe(event => {
2 console.log('Custom event:', event);
3});