From 1490359e4c29743916c065c90f9a3267b0383ad2 Mon Sep 17 00:00:00 2001 From: Timo K Date: Mon, 1 Dec 2025 14:05:41 +0100 Subject: [PATCH] cleanup changes `godot`->`sdk` add docs --- godot/README.md | 14 --------- godot/favicon.ico | Bin 2439 -> 0 bytes index.html | 10 ------ package.json | 4 +-- sdk/README.md | 35 +++++++++++++++++++++ {godot => sdk}/helper.ts | 4 +++ {godot => sdk}/index.html | 4 +-- {godot => sdk}/main.ts | 15 ++++++++- src/state/CallViewModel/CallViewModel.ts | 2 +- tsconfig.json | 2 +- vite-godot.config.js => vite-sdk.config.js | 8 ++--- vite.config.ts | 6 ++-- 12 files changed, 66 insertions(+), 38 deletions(-) delete mode 100644 godot/README.md delete mode 100644 godot/favicon.ico create mode 100644 sdk/README.md rename {godot => sdk}/helper.ts (94%) rename {godot => sdk}/index.html (95%) rename {godot => sdk}/main.ts (94%) rename vite-godot.config.js => vite-sdk.config.js (83%) diff --git a/godot/README.md b/godot/README.md deleted file mode 100644 index 7f00df24..00000000 --- a/godot/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## url parameters -widgetId = $matrix_widget_id -perParticipantE2EE = true -userId = $matrix_user_id -deviceId = $org.matrix.msc3819.matrix_device_id -baseUrl = $org.matrix.msc4039.matrix_base_url - -parentUrl = // will be inserted automatically - -http://localhost?widgetId=&perParticipantE2EE=true&userId=&deviceId=&baseUrl=&roomId= - --> - -http://localhost:3000?widgetId=$matrix_widget_id&perParticipantE2EE=true&userId=$matrix_user_id&deviceId=$org.matrix.msc3819.matrix_device_id&baseUrl=$org.matrix.msc4039.matrix_base_url&roomId=$matrix_room_id diff --git a/godot/favicon.ico b/godot/favicon.ico deleted file mode 100644 index e531e6f274fb3efb29316f441b7057f745758ee3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2439 zcmV;233&F2P)Z$GcPbOEG;=TH6tA!@bK^{BqcdBG?S8&>FMb?FE2SUFU3Q#V=xG9ka78TU#cFhb(k-Ut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aWsdjXfcz+DIIvfhC$^-Sd6#^65OWS+U6@ zW&)5zi3ZaNE7m;QKfZmOC$tU2t}suTktqJ5hq}wbro2xNV^=6wG|I|+GcKmzfIl}U7h3hphBd{THu?JtjEu1eK1G6()(F^0D&J2 z3GkB6i*p-2&qm^A$UCc?bOxH?T~Qf1;*0RD_{?GEbIeH+sK76Acx2h}u9_UP4rE>) z!ZUzdiA@6_qE#*5E4f{?5E4xJe&@L!tT}2KPoNd%GWYBjAeK+f@p z1-MdUhf5BqfredZCGX!rUj<)(2)Vivb7fLG6^4PP58*D@73XuSpOB31D}XPe4wW2U z-i2PrOsAS00c<0NUSuw|uIO&U0N9sNynVUSsr0|1=|Cn-zus;%=XsAx7?Z-_Oak3> zTi)rHE3tT`v}sjlBABG!675wNZ1!Fh4DLDjETokZpu1a16?9z$i>|r&HAvZ;8u?Qx;9Zc$Je6s}%~3#Lv(*AGrq_a_B0>mObYlXb8Fb z`A>j>NwVd=&N&Af*5vG?tW_mG%6q=x9%Q}T?7z1$}D4F)I!SMbZ*yD*LB2b=&@dqN*B+QseXEVOS>X$yY(H;iuNbPImb8SZUy zxfb#A6@VjWFG&PrIbT*Qs%PSRQ8z}pO4<`Rv)H}sXUudBy?53
<% } %> - - - <% if (packageType === "godot") { %> - - - - <% } %> diff --git a/package.json b/package.json index c87d5b01..0b598e97 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "build:embedded": "yarn build:full --config vite-embedded.config.js", "build:embedded:production": "yarn build:embedded", "build:embedded:development": "yarn build:embedded --mode development", - "build:godot": "yarn build:full --config vite-godot.config.js", - "build:godot:development": "yarn build:godot --mode development", + "build:sdk": "yarn build:full --config vite-sdk.config.js", + "build:sdk:development": "yarn build:sdk --mode development", "serve": "vite preview", "prettier:check": "prettier -c .", "prettier:format": "prettier -w .", diff --git a/sdk/README.md b/sdk/README.md new file mode 100644 index 00000000..03801b83 --- /dev/null +++ b/sdk/README.md @@ -0,0 +1,35 @@ +# SDK mode + +EC can be build in sdk mode. This will result in a compiled js file that can be imported in very simple webapps. + +It allows to use matrixRTC in combination with livekit without relying on element call. + +This is done by instantiating the call view model and exposing some useful behaviors (observables) and methods. + +This folder contains an example index.html file that showcases the sdk in use (hosted on localhost:8123 with a webserver ellowing cors (for example `npx serve -l 81234 --cors`)) as a godot engine HTML export template. + +## Widgets + +The sdk mode is particularly interesting to be used in widgets where you do not need to pay attention to matrix login/cs api ... +To create a widget see the example index.html file in this folder. And add it to EW via: +`/addwidget ` (see **url parameters** for more details on ``) + +### url parameters + +``` +widgetId = $matrix_widget_id +perParticipantE2EE = true +userId = $matrix_user_id +deviceId = $org.matrix.msc3819.matrix_device_id +baseUrl = $org.matrix.msc4039.matrix_base_url +``` + +`parentUrl = // will be inserted automatically` + +Full template use as ``: + +``` +http://localhost:3000?widgetId=$matrix_widget_id&perParticipantE2EE=true&userId=$matrix_user_id&deviceId=$org.matrix.msc3819.matrix_device_id&baseUrl=$org.matrix.msc4039.matrix_base_url&roomId=$matrix_room_id +``` + +the `$` prefixed variables will be replaced by EW on widget instantiation. (e.g. `$matrix_user_id` -> `@user:example.com` (url encoding will also be applied automatically by EW) -> `%40user%3Aexample.com`) diff --git a/godot/helper.ts b/sdk/helper.ts similarity index 94% rename from godot/helper.ts rename to sdk/helper.ts index 8f5c710e..7dc2138a 100644 --- a/godot/helper.ts +++ b/sdk/helper.ts @@ -5,6 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ +/** + * This file contains helper functions and types for the MatrixRTC SDK. + */ + import { logger as rootLogger } from "matrix-js-sdk/lib/logger"; import { scan } from "rxjs"; diff --git a/godot/index.html b/sdk/index.html similarity index 95% rename from godot/index.html rename to sdk/index.html index 39bcf484..c66274ff 100644 --- a/godot/index.html +++ b/sdk/index.html @@ -4,8 +4,8 @@ Godot MatrixRTC Widget