(origin: string, clientId: string)
| 81 | } |
| 82 | |
| 83 | export function buildWsUrl(origin: string, clientId: string): string { |
| 84 | const url = new URL(`${origin}/api/v1/ws`); |
| 85 | url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:'; |
| 86 | url.searchParams.set('client_id', clientId); |
| 87 | return url.toString(); |
| 88 | } |
| 89 | |
| 90 | function getClientId(): string { |
| 91 | const stored = safeGetString(CLIENT_ID_KEY); |
no test coverage detected