🧑‍💻 Improve env variables type safety and management (#718)

Closes #679
This commit is contained in:
Baptiste Arnaud
2023-08-28 09:13:53 +02:00
committed by GitHub
parent a23a8c4456
commit 786e5cb582
148 changed files with 1550 additions and 1293 deletions

View File

@@ -1,8 +1,8 @@
import { env } from '@typebot.io/lib'
import { env } from '@typebot.io/env'
const cloudViewerUrl = 'https://viewer.typebot.io'
export const guessApiHost = () =>
env('VIEWER_INTERNAL_URL') ??
env('VIEWER_URL')?.split(',')[0] ??
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
env.NEXT_PUBLIC_VIEWER_URL[0] ??
cloudViewerUrl