Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ingress-enabled-option.md
Original file line number Diff line number Diff line change
@@ -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`.
15 changes: 14 additions & 1 deletion packages/livekit-server-sdk/src/IngressClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -180,6 +191,7 @@ export class IngressClient extends ServiceBase {
bypassTranscoding,
enableTranscoding,
url,
enabled,
audio,
video,
}).toJson();
Expand All @@ -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,
Expand All @@ -214,6 +226,7 @@ export class IngressClient extends ServiceBase {
participantMetadata,
bypassTranscoding,
enableTranscoding,
enabled,
audio,
video,
}).toJson();
Expand Down
Loading