diff --git a/apps/docs/self-hosting/configuration.mdx b/apps/docs/self-hosting/configuration.mdx index dc5f40b93..80fa995da 100644 --- a/apps/docs/self-hosting/configuration.mdx +++ b/apps/docs/self-hosting/configuration.mdx @@ -312,3 +312,12 @@ The related environment variables are listed here but you are probably not inter | NEXT_PUBLIC_POSTHOG_HOST | https://app.posthog.com | PostHog API Host | + + + +| Parameter | Default | Description | +| ------------------------------- | ---------------------------------------- | ----------- | +| NEXT_PUBLIC_VIEWER_404_TITLE | 404 | | +| NEXT_PUBLIC_VIEWER_404_SUBTITLE | The bot you're looking for doesn't exist | | + + diff --git a/apps/viewer/src/components/NotFoundPage.tsx b/apps/viewer/src/components/NotFoundPage.tsx index 1c95d423c..3b063e97c 100644 --- a/apps/viewer/src/components/NotFoundPage.tsx +++ b/apps/viewer/src/components/NotFoundPage.tsx @@ -1,3 +1,5 @@ +import { env } from '@typebot.io/env' + export const NotFoundPage = () => (
( flexDirection: 'column', }} > -

404

-

The bot you're looking for doesn't exist

+

+ {env.NEXT_PUBLIC_VIEWER_404_TITLE} +

+

{env.NEXT_PUBLIC_VIEWER_404_SUBTITLE}

) diff --git a/packages/env/env.ts b/packages/env/env.ts index ef5b5d0dd..b13ab51a7 100644 --- a/packages/env/env.ts +++ b/packages/env/env.ts @@ -99,6 +99,11 @@ const baseEnv = { ), NEXT_PUBLIC_ONBOARDING_TYPEBOT_ID: z.string().min(1).optional(), NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE: z.coerce.number().optional(), + NEXT_PUBLIC_VIEWER_404_TITLE: z.string().optional().default('404'), + NEXT_PUBLIC_VIEWER_404_SUBTITLE: z + .string() + .optional() + .default("The bot you're looking for doesn't exist"), }, runtimeEnv: { NEXT_PUBLIC_E2E_TEST: getRuntimeVariable('NEXT_PUBLIC_E2E_TEST'), @@ -109,6 +114,12 @@ const baseEnv = { NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE: getRuntimeVariable( 'NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE' ), + NEXT_PUBLIC_VIEWER_404_TITLE: getRuntimeVariable( + 'NEXT_PUBLIC_VIEWER_404_TITLE' + ), + NEXT_PUBLIC_VIEWER_404_SUBTITLE: getRuntimeVariable( + 'NEXT_PUBLIC_VIEWER_404_SUBTITLE' + ), }, } const githubEnv = {