From 61e353d91977b7a804c4fe45b6de79f66241797c Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Fri, 2 Oct 2026 14:14:32 +0200 Subject: [PATCH] renames + rewriting docs --- sdk/README.md | 19 +- sdk/SdkArchitecture.md | 570 ++++++++++++++++++ sdk/SdkMigration.md | 328 ++++++++++ sdk/dev/main.ts | 24 +- sdk/index.ts | 2 +- sdk/src/api.ts | 42 +- sdk/src/session/KeyProvider.ts | 4 +- sdk/src/session/LocalMember.ts | 33 +- .../{RtcSession.ts => MatrixRTCClient.ts} | 75 ++- sdk/src/session/Members.ts | 22 +- ...{joinRtcSession.ts => joinJsSdkSession.ts} | 19 +- sdk/src/session/status.test.ts | 4 +- sdk/src/session/status.ts | 6 +- sdk/src/utils/errors.test.ts | 20 +- sdk/src/utils/errors.ts | 10 +- 15 files changed, 1061 insertions(+), 117 deletions(-) create mode 100644 sdk/SdkArchitecture.md create mode 100644 sdk/SdkMigration.md rename sdk/src/session/{RtcSession.ts => MatrixRTCClient.ts} (78%) rename sdk/src/session/{joinRtcSession.ts => joinJsSdkSession.ts} (82%) diff --git a/sdk/README.md b/sdk/README.md index 29be57e1a..a01bba509 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -3,10 +3,11 @@ `@element-hq/matrixrtc-sdk` is the call model under Element Call, on its own: MatrixRTC memberships and transports, LiveKit connections, publishing, E2EE keys and the media of every member, as observables. It has no UI. Element Call's own -`CallViewModel` is meant to become one consumer of it; the design is in -[`sdk-plan.md`](../sdk-plan.md). +`CallViewModel` is meant to become one consumer of it. The design is in +[`SdkArchitecture.md`](./SdkArchitecture.md), the migration from the view model +in [`SdkMigration.md`](./SdkMigration.md). -**Status:** first implementation. `createRtcSession` joins the session, connects to +**Status:** first implementation. `createMatrixRTCClient` joins the session, connects to the transport, publishes the local media and exposes every member's media; the development harness and its e2e tests in `playwright/sdk` drive it. The implementation still imports the building blocks it shares with Element Call from @@ -17,17 +18,17 @@ implementation still imports the building blocks it shares with Element Call fro ```ts import { constant, - createRtcSession, + createMatrixRTCClient, E2eeType, MatrixRTCMode, ObservableScope, } from "@element-hq/matrixrtc-sdk"; const scope = new ObservableScope(); -const session = createRtcSession( +const rtcClient = createMatrixRTCClient( scope, client, // a matrix-js-sdk MatrixClient, logged in and syncing - room, // the matrix-js-sdk Room to hold the session in, from client.getRoom() + room, // the matrix-js-sdk Room, from client.getRoom() once the join has synced { microphoneEnabled$: constant(true), cameraEnabled$: constant(true), @@ -40,15 +41,15 @@ const session = createRtcSession( matrixRTCMode: MatrixRTCMode.Compatibility, }, ); -session.join(); +rtcClient.join(); -session.remoteMembers$.subscribe((members) => { +rtcClient.remoteMembers$.subscribe((members) => { // each member has displayName$, media$ and more; a media track is rendered // by handing it a