MCPcopy
hub / github.com/simstudioai/sim / getTwitchParent

Function getTwitchParent

packages/utils/src/media-embed.ts:16–18  ·  view source on GitHub ↗

* The `parent` query param required by Twitch embeds. Reads the current host in * the browser and falls back to `localhost` during SSR.

()

Source from the content-addressed store, hash-verified

14 * the browser and falls back to `localhost` during SSR.
15 */
16function getTwitchParent(): string {
17 return typeof window !== 'undefined' ? window.location.hostname : 'localhost'
18}
19
20/** Parse a URL, tolerating scheme-less inputs (https is assumed). Returns null if unparseable. */
21function parseUrl(url: string): URL | null {

Callers 1

getEmbedInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected