Skip to content

🪢 feat: Langfuse Connection Configuration#94

Draft
dustinhealy wants to merge 7 commits into
mainfrom
langfuse-connection-ui
Draft

🪢 feat: Langfuse Connection Configuration#94
dustinhealy wants to merge 7 commits into
mainfrom
langfuse-connection-ui

Conversation

@dustinhealy

Copy link
Copy Markdown
Contributor

Depends on the LibreChat side shipping langfuse in librechat-data-provider's configSchema (danny-avila/LibreChat#14107).

Until a data-provider version defining langfuse is published and pinned here, a forward-compat shim (LANGFUSE_SHIM_FIELD in src/server/config.ts) injects the section into the schema tree; it self-disables once the pinned data-provider defines langfuse, and can then be removed.

Summary

Adds a per-tenant Langfuse connection section to the configuration page (Features tab): enable toggle, host, public key, write-only secret key, and a test-connection action. Values are saved through the existing /api/admin/config field API; the secret is encrypted at rest and reads return only a fingerprint, never the key.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

Local CI gates green: bunx eslint src/ --max-warnings 0, bunx tsc --noEmit, bun run test.

Manual, against a local LibreChat backend on :3080 with the admin panel on :3010:

  1. Config -> Features -> Langfuse: enter host / public key / secret key, toggle Enable, Test connection, Save.
  2. Confirmed the secret is stored encrypted (v3: prefix) with a secretKeyFingerprint, reads redact the secret, and reload repopulates host/public-key with the secret masked and the fingerprint shown.

Empty / Unconfigured

langfuse-1-empty

Filled (secret masked)

langfuse-2-filled

Successful Test Connection

langfuse-3-test-success

Configured / Saved

langfuse-4-configured-saved

Note: Toggle is to right of text in final form - screenshots were taken prior to that change:

Screenshot 2026-07-04 at 3 40 56 PM

Test Configuration:

LibreChat backend on :3080 (branch langfuse-config-encryption), local MongoDB, admin user.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes
  • I have written tests demonstrating that my changes are effective

Surface a per-tenant Langfuse connection section (enabled, base URL, public
key, secret key) in the admin config UI. It saves through the existing
/api/admin/config field API.

The pinned librechat-data-provider (0.8.509) predates the langfuse config
group, so a forward-compat shim extends configSchema locally until a
data-provider version defining langfuse is published and pinned, mirroring the
READ_AUDIT_LOG capability shim. The shim no-ops once upstream ships it.
Custom section renderer for the Langfuse config: enable toggle, host, public
key, a masked (PasswordInput) secret that is write-only and only sent on change,
the configured-key fingerprint returned by the backend, and a Test connection
action. Adds an admin-gated testLangfuseConnectionFn that validates credentials
against the Langfuse public projects endpoint.
Inject the langfuse section as a SchemaField instead of extending the pinned
data-provider schema, which mixed zod v4 (app) with v3 (data-provider) and left
the section unintrospected so it fell back to the generic renderer. Read saved
values from parentValue (the base config slice) rather than getValue leaf paths,
which only resolve edited/scope values, so a configured connection repopulates
on reload with the secret redacted and its fingerprint shown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant