Add config

This commit is contained in:
dtonon 2026-03-25 22:29:46 +01:00
parent 2f91fe8572
commit dd3343184d
3 changed files with 15 additions and 2 deletions

3
.env.example Normal file
View file

@ -0,0 +1,3 @@
PUBLIC_RELAY_URL=ws://localhost:3334
PUBLIC_GROUP_ID=mygrouprandomid
PUBLIC_MODE=simple # simple | full

10
src/lib/config.ts Normal file
View file

@ -0,0 +1,10 @@
import {
PUBLIC_RELAY_URL,
PUBLIC_GROUP_ID,
PUBLIC_MODE,
} from "$env/static/public";
export const RELAY_URL = PUBLIC_RELAY_URL;
export const GROUP_ID = PUBLIC_GROUP_ID;
export const MODE: "simple" | "full" =
PUBLIC_MODE === "full" ? "full" : "simple";

View file

@ -7,11 +7,11 @@
import { page } from "$app/state"; import { page } from "$app/state";
import { onMount } from "svelte"; import { onMount } from "svelte";
import { restoreSession } from "$lib/auth.svelte"; import { restoreSession } from "$lib/auth.svelte";
import { MODE } from "$lib/config";
let { children } = $props(); let { children } = $props();
// In full mode, extract active room from the URL const mode = MODE;
const mode: "simple" | "full" = "full";
const chatEnabled = true; const chatEnabled = true;
onMount(restoreSession); onMount(restoreSession);