From 82d39d325643bae610f987bf4cdabc782f7b6f40 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Tue, 4 Mar 2025 16:33:16 -0800 Subject: [PATCH] Env-vars: document Message of the day and new variables. --- docs/customizations.md | 17 ++++++++++++++++- docs/environment-variables.md | 14 +++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/customizations.md b/docs/customizations.md index 9aeb40097..b240ae1b1 100644 --- a/docs/customizations.md +++ b/docs/customizations.md @@ -41,7 +41,7 @@ you can for instance set the build command to: mv vercel_PRODUCTION.json vercel.json; next build ``` -### Change the Personas +### Change the Personas (v1.x only) Edit the `src/data.ts` file to customize personas. This file houses the default personas. You can add, remove, or modify these to meet your project's needs. @@ -55,6 +55,21 @@ Adapt the UI to match your project's aesthetic, incorporate new features, or exc - [ ] Modify `src/common/app.config.tsx` to alter the application's name - [ ] Update `src/common/app.nav.tsx` to revise the navigation bar +### Add a Message of the Day + +You can display a temporary announcement banner at the top of the app using the `NEXT_PUBLIC_MOTD` environment variable. + +- Set this variable in your deployment environment +- The message supports template variables: + - `{{app_build_hash}}`: Current git commit hash + - `{{app_build_pkgver}}`: Package version + - `{{app_build_time}}`: Build timestamp as date + - `{{app_deployment_type}}`: Deployment type (local, docker, vercel, etc.) +- Users can dismiss the message (until next page refresh) +- Use it for version announcements, maintenance notices, or feature highlights + +Example: `NEXT_PUBLIC_MOTD=🚀 New features available in {{app_build_pkgver}}! Try the improved Beam.` + ## Testing & Deployment Test your application thoroughly using local development (refer to README.md for local build instructions). Deploy using your preferred hosting service. big-AGI supports deployment on platforms like Vercel, Docker, or any Node.js-compatible service, especially those supporting NextJS's "Edge Runtime." diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 8b7669634..bffe3251c 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -64,8 +64,10 @@ HTTP_BASIC_AUTH_USERNAME= HTTP_BASIC_AUTH_PASSWORD= -# Frontend variables +# Frontend variables +NEXT_PUBLIC_MOTD= NEXT_PUBLIC_GA4_MEASUREMENT_ID= +NEXT_PUBLIC_POSTHOG_KEY= NEXT_PUBLIC_PLANTUML_SERVER_URL= ``` @@ -146,10 +148,12 @@ Enable the app to Talk, Draw, and Google things up. The value of these variables are passed to the frontend (Web UI) - make sure they do not contain secrets. -| Variable | Description | -|:----------------------------------|:-----------------------------------------------------------------------------------------| -| `NEXT_PUBLIC_GA4_MEASUREMENT_ID` | The measurement ID for Google Analytics 4. (see [deploy-analytics](deploy-analytics.md)) | -| `NEXT_PUBLIC_PLANTUML_SERVER_URL` | The URL of the PlantUML server, used for rendering UML diagrams. (code in RederCode.tsx) | +| Variable | Description | +|:----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `NEXT_PUBLIC_MOTD` | Message of the Day - displays a dismissible banner at the top of the app (see [customizations](customizations.md) for the template variables). Example: 🔔 Welcome to our deployment! Version {{app_build_pkgver}} built on {{app_build_time}}. | +| `NEXT_PUBLIC_GA4_MEASUREMENT_ID` | (optional) The measurement ID for Google Analytics 4. (see [deploy-analytics](deploy-analytics.md)) | +| `NEXT_PUBLIC_POSTHOG_KEY` | (optional) Key for PostHog analytics. (see [deploy-analytics](deploy-analytics.md)) | +| `NEXT_PUBLIC_PLANTUML_SERVER_URL` | The URL of the PlantUML server, used for rendering UML diagrams. Allows using custom local servers. | > Important: these variables must be set at build time, which is required by Next.js to pass them to the frontend. > This is in contrast to the backend variables, which can be set when starting the local server/container.