✨ feat: Add server-side support for APP_TITLE and APP_DESCRIPTION metadata#12385
✨ feat: Add server-side support for APP_TITLE and APP_DESCRIPTION metadata#12385ucodia wants to merge 1 commit intodanny-avila:mainfrom
APP_TITLE and APP_DESCRIPTION metadata#12385Conversation
|
Here's an automated review I ran: What's GoodThe approach is straightforward, follows the existing Issues to Fix Before Merge1. No real test coverage 2. The SEO pitch doesn't hold up 3. Inconsistent backend pattern Minor/Polish
|
|
Thanks for the feedback @danny-avila I did not indeed realize that a JS runtime update the DOM would defeat SEO in crawling/no JS scenarios. This actually reveals a more systematic issue with how LibreChat update the This does need rework so I will think of a different strategy which may benefit all SEO and metadata related elements, including the app manifest. |
… metadata Apply title and description from environment variables at the server level so that crawlers and SEO tools see the correct values without JavaScript. Also serve a dynamically-patched `manifest.webmanifest` reflecting both values for PWA contexts. Client-side hooks are preserved for SPA navigation and dev mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9c8773c to
c4a0145
Compare
APP_DESCRIPTION environment variable to set the application's meta descriptionAPP_TITLE and APP_DESCRIPTION metadata
|
@danny-avila updated accordingly so that it works for SEO as you highlighted and added relevant tests. In fact this was already not happening with the |
Summary
APP_DESCRIPTIONenvironment variable that allows operators to customize the HTML<meta name="description">tag content at runtime, following the same pattern as the existingAPP_TITLEenv var.APP_TITLEandAPP_DESCRIPTIONare now injected server-side into the HTML at startup, so crawlers and social-sharing previews see the correct values without JavaScript.manifest.webmanifestis dynamically served withname,short_name, anddescriptionreflecting the configured values.defaultAppTitle,defaultAppDescription) ensure consistent fallback values across the codebase.Change Type
Testing
Test Configuration:
APP_TITLE=My AppandAPP_DESCRIPTION=My custom descriptionin.envcurl http://localhost:3080/— confirm<title>My App</title>and<meta name="description" content="My custom description"appear in the raw HTML (no JS required)curl http://localhost:3080/manifest.webmanifest— confirm"name": "My App","short_name": "My App", and"description": "My custom description"http://localhost:3080/api/config— confirm"appTitle": "My App"and"appDescription": "My custom description"are present<title>and<meta name="description">tags, confirm they match the configured valuescd packages/api && npx jest appMetadata— 12 tests passChecklist
APP_DESCRIPTIONoption and clarifyAPP_TITLEdescription. LibreChat-AI/librechat.ai#543