From 4b0e227bd9f54f0728b13c3e17161ba0773e962a Mon Sep 17 00:00:00 2001 From: Stefan King <108685944+stefanking-difference@users.noreply.github.com> Date: Wed, 1 Jul 2026 12:19:45 +0200 Subject: [PATCH] feat(server-sdk): expose ingress `enabled` option on create/updateIngress The `enabled` field already exists on the protobuf CreateIngressRequest/UpdateIngressRequest (protocol#935) and is enforced by the ingress service (ingress#319), but was not surfaced through the typed CreateIngressOptions/UpdateIngressOptions, so callers had to send it via raw Twirp. Expose it in both option types and map it into the requests. Setting enabled=false rejects new connection attempts while preserving the stream key. --- .changeset/ingress-enabled-option.md | 5 +++++ packages/livekit-server-sdk/src/IngressClient.ts | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .changeset/ingress-enabled-option.md diff --git a/.changeset/ingress-enabled-option.md b/.changeset/ingress-enabled-option.md new file mode 100644 index 00000000..6313f256 --- /dev/null +++ b/.changeset/ingress-enabled-option.md @@ -0,0 +1,5 @@ +--- +'livekit-server-sdk': patch +--- + +Add `enabled` option to `createIngress` and `updateIngress`. Setting `enabled: false` lets you disable an ingress session (reject new connection attempts) without deleting it, so the stream key is preserved. The field already exists on the protobuf `CreateIngressRequest`/`UpdateIngressRequest`; this exposes it through the typed `CreateIngressOptions`/`UpdateIngressOptions`. diff --git a/packages/livekit-server-sdk/src/IngressClient.ts b/packages/livekit-server-sdk/src/IngressClient.ts index f0198720..51afa968 100644 --- a/packages/livekit-server-sdk/src/IngressClient.ts +++ b/packages/livekit-server-sdk/src/IngressClient.ts @@ -52,6 +52,11 @@ export interface CreateIngressOptions { * url of the media to pull for ingresses of type URL */ url?: string; + /** + * whether the ingress is enabled. When set to false, new connection attempts are rejected + * while the stream key is preserved. The default is true. + */ + enabled?: boolean; /** * custom audio encoding parameters. optional */ @@ -93,6 +98,11 @@ export interface UpdateIngressOptions { * Transcoding is required for all input types except WHIP. For WHIP, the default is to not transcode. */ enableTranscoding?: boolean | undefined; + /** + * whether the ingress is enabled. When set to false, new connection attempts are rejected + * while the stream key is preserved. The default is true. + */ + enabled?: boolean; /** * custom audio encoding parameters. optional */ @@ -152,6 +162,7 @@ export class IngressClient extends ServiceBase { const roomName: string | undefined = opts.roomName; const enableTranscoding: boolean | undefined = opts.enableTranscoding; + const enabled: boolean | undefined = opts.enabled; const audio: IngressAudioOptions | undefined = opts.audio; const video: IngressVideoOptions | undefined = opts.video; const participantMetadata: string | undefined = opts.participantMetadata; @@ -180,6 +191,7 @@ export class IngressClient extends ServiceBase { bypassTranscoding, enableTranscoding, url, + enabled, audio, video, }).toJson(); @@ -203,7 +215,7 @@ export class IngressClient extends ServiceBase { const participantName: string = opts.participantName || ''; const participantIdentity: string = opts.participantIdentity || ''; const { participantMetadata } = opts; - const { audio, video, bypassTranscoding, enableTranscoding } = opts; + const { audio, video, bypassTranscoding, enableTranscoding, enabled } = opts; const req = new UpdateIngressRequest({ ingressId, @@ -214,6 +226,7 @@ export class IngressClient extends ServiceBase { participantMetadata, bypassTranscoding, enableTranscoding, + enabled, audio, video, }).toJson();