/** * Kill switch client — thin wrapper over @bytelyst/kill-switch-client. * * Checks platform-service on app init. If killed, disables timer creation * and shows maintenance banner. Fail-open on any error (app stays usable). * * Privacy: sends productId + platform only. No PII. */ import { createKillSwitchClient } from '@bytelyst/kill-switch-client'; import { PRODUCT_ID, getBaseUrl } from './auth-api'; const killSwitchClient = createKillSwitchClient({ baseUrl: `${getBaseUrl()}/api`, productId: PRODUCT_ID, platform: 'web', }); /** * Check if the app is disabled via kill switch. * Returns true if the app should be disabled. * Fail-open: returns false on any error so the app stays usable. */ export async function checkKillSwitch(): Promise { const result = await killSwitchClient.check().catch(() => { return { disabled: false, message: null }; }); return result.disabled; } export { killSwitchClient };