From d70f2a1aa1cf85bee381ec7048b5a9dfe49fae17 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Wed, 27 May 2026 11:56:22 +0800 Subject: [PATCH 1/3] Add token revocation timestamp to RemoveParticipant User can provide timestamp to invalidate token whose nbf is before this value. --- .changeset/fuzzy-trains-lose.md | 5 +++++ packages/livekit-server-sdk/package.json | 2 +- .../src/RoomServiceClient.ts | 20 +++++++++++++++++-- pnpm-lock.yaml | 10 +++++----- 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .changeset/fuzzy-trains-lose.md diff --git a/.changeset/fuzzy-trains-lose.md b/.changeset/fuzzy-trains-lose.md new file mode 100644 index 00000000..a7520fd4 --- /dev/null +++ b/.changeset/fuzzy-trains-lose.md @@ -0,0 +1,5 @@ +--- +'livekit-server-sdk': patch +--- + +Add token revocation timestamp to RemoveParticipant diff --git a/packages/livekit-server-sdk/package.json b/packages/livekit-server-sdk/package.json index 7eaf44f1..441cbcde 100644 --- a/packages/livekit-server-sdk/package.json +++ b/packages/livekit-server-sdk/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@bufbuild/protobuf": "^1.10.1", - "@livekit/protocol": "^1.45.6", + "@livekit/protocol": "^1.46.3", "camelcase-keys": "^9.0.0", "jose": "^5.1.2" }, diff --git a/packages/livekit-server-sdk/src/RoomServiceClient.ts b/packages/livekit-server-sdk/src/RoomServiceClient.ts index 39097cf4..8bdff547 100644 --- a/packages/livekit-server-sdk/src/RoomServiceClient.ts +++ b/packages/livekit-server-sdk/src/RoomServiceClient.ts @@ -108,6 +108,13 @@ export type UpdateParticipantOptions = { name?: string; }; +export type RemoveParticipantOptions = { + /** + * Unix timestamp used to invalidate tokens whose nbf is before this value. + */ + revokeTokenTs?: bigint; +}; + const svc = 'RoomService'; /** @@ -226,12 +233,21 @@ export class RoomServiceClient extends ServiceBase { * Even after being removed, the participant can still re-join the room. * @param room - * @param identity - + * @param options - removal options */ - async removeParticipant(room: string, identity: string): Promise { + async removeParticipant( + room: string, + identity: string, + options?: RemoveParticipantOptions, + ): Promise { await this.rpc.request( svc, 'RemoveParticipant', - new RoomParticipantIdentity({ room, identity }).toJson(), + new RoomParticipantIdentity({ + room, + identity, + revokeTokenTs: options?.revokeTokenTs, + }).toJson(), await this.authHeader({ roomAdmin: true, room }), ); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82a8f6a9..d0bc6795 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,8 +250,8 @@ importers: specifier: ^1.10.1 version: 1.10.1 '@livekit/protocol': - specifier: ^1.45.6 - version: 1.45.6 + specifier: ^1.46.3 + version: 1.46.3 camelcase-keys: specifier: ^9.0.0 version: 9.1.3 @@ -962,8 +962,8 @@ packages: '@livekit/mutex@1.1.1': resolution: {integrity: sha512-EsshAucklmpuUAfkABPxJNhzj9v2sG7JuzFDL4ML1oJQSV14sqrpTYnsaOudMAw9yOaW53NU3QQTlUQoRs4czw==} - '@livekit/protocol@1.45.6': - resolution: {integrity: sha512-YPDmrUiVe1EY/q/2bD+Fp+69DWq6LZgeH+G/KEbz07OIVf8hgAYzfb1FgiOdWLRpSj06+SuTmrOY604fWNuD3w==} + '@livekit/protocol@1.46.3': + resolution: {integrity: sha512-YvsE4UN5i+wY9vXfwhF6EUrRyUm/YhiFU1jBcsmsLd/xodUJxYTBcWS4OgL4IJffjzIoyxsrbKp1h9qC55mtcQ==} '@livekit/rtc-ffi-bindings-darwin-arm64@0.12.60': resolution: {integrity: sha512-YHXqybkYfaTc3txJXXWoVogiSP3yKJdkaZlIlZ6IDMGnN9elUoHDYU+ZSn/rbdGu0pp4HUOzffXkbkItN735Bw==} @@ -4622,7 +4622,7 @@ snapshots: '@livekit/mutex@1.1.1': {} - '@livekit/protocol@1.45.6': + '@livekit/protocol@1.46.3': dependencies: '@bufbuild/protobuf': 1.10.1 From 8ac2057a01576a7ac5de63dad4b359821b91ee01 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Wed, 27 May 2026 12:35:58 +0800 Subject: [PATCH 2/3] ci --- pnpm-lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0bc6795..66b24d35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: examples/agent-dispatch: dependencies: '@livekit/protocol': - specifier: ^1.45.6 - version: 1.45.6 + specifier: ^1.46.3 + version: 1.46.3 dotenv: specifier: ^16.4.5 version: 16.4.5 From c59dc4d1d602cdac43756b16feac5fda062cb99b Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Wed, 27 May 2026 12:43:31 +0800 Subject: [PATCH 3/3] dep --- examples/agent-dispatch/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/agent-dispatch/package.json b/examples/agent-dispatch/package.json index dc86b044..4e67a3db 100644 --- a/examples/agent-dispatch/package.json +++ b/examples/agent-dispatch/package.json @@ -14,7 +14,7 @@ "dependencies": { "dotenv": "^16.4.5", "livekit-server-sdk": "workspace:*", - "@livekit/protocol": "^1.45.6" + "@livekit/protocol": "^1.46.3" }, "devDependencies": { "@types/node": "^20.10.4",