runtimeMode.ts
470 bytes
| 1 | export function applyDemoMode(argv: readonly string[], env: NodeJS.ProcessEnv): boolean { |
|---|---|
| 2 | // A public instance is always locked to the offline mocks: there are no |
| 3 | // provider keys on it, and nothing a visitor sends can add any. |
| 4 | const enabled = argv.includes('--demo') || env.VOICETASK_PUBLIC === '1' |
| 5 | if (enabled) env.MOCK_PROVIDERS = '1' |
| 6 | return enabled |
| 7 | } |
| 8 | |
| 9 | export function isPublicDemo(env: NodeJS.ProcessEnv): boolean { |
| 10 | return env.VOICETASK_PUBLIC === '1' |
| 11 | } |
| 12 | |