Skip to content

Commit bfd4bb2

Browse files
authored
Show URL params and environment variables in developer tab (#3134)
1 parent f845397 commit bfd4bb2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

locales/en/app.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@
6565
"debug_tile_layout_label": "Debug tile layout",
6666
"device_id": "Device ID: {{id}}",
6767
"duplicate_tiles_label": "Number of additional tile copies per participant",
68+
"environment_variables": "Environment variables",
6869
"hostname": "Hostname: {{hostname}}",
6970
"livekit_server_info": "LiveKit Server Info",
7071
"livekit_sfu": "LiveKit SFU: {{url}}",
7172
"matrix_id": "Matrix ID: {{id}}",
7273
"show_connection_stats": "Show connection statistics",
7374
"show_non_member_tiles": "Show tiles for non-member media",
75+
"url_params": "URL parameters",
7476
"use_new_membership_manager": "Use the new implementation of the call MembershipManager"
7577
},
7678
"disconnected_banner": "Connectivity to the server has been lost.",

src/settings/DeveloperSettingsTab.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
import type { MatrixClient } from "matrix-js-sdk";
2121
import type { Room as LivekitRoom } from "livekit-client";
2222
import styles from "./DeveloperSettingsTab.module.css";
23+
import { useUrlParams } from "../UrlParams";
2324
interface Props {
2425
client: MatrixClient;
2526
livekitRoom?: LivekitRoom;
@@ -43,6 +44,8 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRoom }) => {
4344
useNewMembershipManagerSetting,
4445
);
4546

47+
const urlParams = useUrlParams();
48+
4649
const sfuUrl = useMemo((): URL | null => {
4750
if (livekitRoom?.engine.client.ws?.url) {
4851
// strip the URL params
@@ -169,6 +172,10 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRoom }) => {
169172
</pre>
170173
</>
171174
) : null}
175+
<p>{t("developer_mode.environment_variables")}</p>
176+
<pre>{JSON.stringify(import.meta.env, null, 2)}</pre>
177+
<p>{t("developer_mode.url_params")}</p>
178+
<pre>{JSON.stringify(urlParams, null, 2)}</pre>
172179
</>
173180
);
174181
};

0 commit comments

Comments
 (0)