Files
wizwar6e/packages/web/src/main.ts
T
Eric WagonerandClaude Fable 5 b06da1f1f1 Sentry plumbing, inert until a DSN exists
Server: errors-only @sentry/node behind SENTRY_DSN, capturing the
unhandled-protocol catch with its message type and room. Client:
errors-only @sentry/browser behind VITE_SENTRY_DSN baked at build.
Backup: Sentry Crons check-ins (in_progress/ok/error) when
/root/.wizwar-sentry-cron holds the check-in URL. No DSN, no behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
2026-09-01 09:58:26 -04:00

18 lines
748 B
TypeScript

import { mount } from "svelte";
import * as Sentry from "@sentry/browser";
// Errors only — no tracing, no replay. Without a DSN baked at build time
// (VITE_SENTRY_DSN in .env.production) this is entirely inert.
if (import.meta.env.VITE_SENTRY_DSN) {
Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, environment: "production" });
}
// /watch/<id> is the public share page — one turn, anyone may look. It
// loads its own component so the full app (and its live socket appetite)
// stays out of a shared link's way.
const target = document.getElementById("app")!;
const page = location.pathname.startsWith("/watch/")
? import("./SharePage.svelte")
: import("./App.svelte");
page.then(({ default: Root }) => mount(Root, { target }));