Interface RealtimeSessionExperimental

The minimum contract for a long-lived realtime session.

Extensions may add any model-specific fields and methods they need. The client only standardizes teardown so callers always have one reliable way to release the resources owned by a session.

The fal.realtime.open() extension API is experimental and may change in a minor release.

interface RealtimeSession {
    state?: RealtimeState;
    close(): void | Promise<void>;
}

Properties

Methods

Properties

Coarse lifecycle, uniform across every extension.

An extension's own OPERATIONS stay its own: they carry meaning only inside their protocol, and nothing is gained by forcing them into a shared shape. "Is this opening, live, or dead" is the opposite — every protocol has it, each names it in its own vocabulary, and leaving it to the extensions makes an application that renders a single status indicator branch per protocol.

Deliberately four values. Anything finer is protocol detail: a state that is meaningful while one protocol negotiates may not exist in another that spends thirty seconds building before it can stream at all. Detail belongs in RealtimeDiagnostic.

OPTIONAL here because no extension has to implement it — the kernel supplies it on the session it hands back, so what open() returns always has one. See ManagedRealtimeSession.

Methods