🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(ee): add additional logo (#3404)
Marc Klingen7158a41fe9e0
diff --git a/.env.prod.example b/.env.prod.exampleindex 0ab38c103a..052e0182cf 100644--- a/.env.prod.example+++ b/.env.prod.example@@ -127,6 +127,8 @@ ENCRYPTION_KEY="0000000000000000000000000000000000000000000000000000000000000000# LANGFUSE_UI_DOCUMENTATION_HREF=https://docs.example.com# LANGFUSE_UI_SUPPORT_HREF=https://support.example.com# LANGFUSE_UI_FEEDBACK_HREF=https://feedback.example.com+# LANGFUSE_UI_LOGO_LIGHT_MODE_HREF=https://static.langfuse.com/langfuse-dev/example-logo-light-mode.png+# LANGFUSE_UI_LOGO_DARK_MODE_HREF=https://static.langfuse.com/langfuse-dev/example-logo-dark-mode.png### END Enterprise Edition Configurationdiff --git a/web/src/components/LangfuseLogo.tsx b/web/src/components/LangfuseLogo.tsxindex c2e146b7c8..2857168e68 100644--- a/web/src/components/LangfuseLogo.tsx+++ b/web/src/components/LangfuseLogo.tsx@@ -3,6 +3,8 @@ import Link from "next/link";import { EnvLabel } from "./EnvLabel";import { VersionLabel } from "./VersionLabel";import { env } from "@/src/env.mjs";+import { useUiCustomization } from "@/src/ee/features/ui-customization/useUiCustomization";+import { PlusIcon } from "lucide-react";export const LangfuseIcon = ({size = 32,@@ -21,6 +23,51 @@ export const LangfuseIcon = ({/>);+const LangfuseLogotypeOrCustomized = ({ size }: { size: "sm" | "xl" }) => {+ const uiCustomization = useUiCustomization();++ if (uiCustomization?.logoLightModeHref && uiCustomization?.logoDarkModeHref) {+ return (+ <div className="flex items-center gap-1">+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img+ src={uiCustomization.logoLightModeHref}+ alt="Langfuse Logo"+ className={cn(+ "dark:hidden",+ size === "sm" ? "max-h-4 max-w-14" : "max-h-5 max-w-16",+ )}+ />+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img+ src={uiCustomization.logoDarkModeHref}+ alt="Langfuse Logo"+ className={cn(+ "hidden dark:block",+ size === "sm" ? "max-h-4 max-w-14" : "max-h-5 max-w-16",+ )}+ />+ <PlusIcon size={size === "sm" ? 8 : 12} />+ <LangfuseIcon size={size === "sm" ? 16 : 20} />+ </div>+ );+ }++ return (+ <div className="flex items-center">+ <LangfuseIcon size={size === "sm" ? 16 : 20} />+ <span+ className={cn(+ "ml-2 font-mono font-semibold",+ size === "sm" ? "text-sm" : "text-xl",+ )}+ >+ Langfuse+ </span>+ </div>+ );+};+export const LangfuseLogo = ({className,size = "sm",@@ -31,26 +78,23 @@ export const LangfuseLogo = ({className?: string;version?: boolean;showEnvLabel?: boolean;-}) => (- <div- className={cn("flex flex-wrap gap-4 lg:flex-col lg:items-start", className)}- >- {/* Environment Labeling for Langfuse Maintainers */}- {showEnvLabel && <EnvLabel />}- {/* Langfuse Logo */}- <div className="flex items-center">- <Link href="/" className="flex items-center">- <LangfuseIcon size={size === "sm" ? 16 : 20} />- <span- className={cn(- "ml-2 font-mono font-semibold",- size === "sm" ? "text-sm" : "text-xl",- )}- >- Langfuse- </span>- </Link>- {version && <VersionLabel className="ml-2" />}+}) => {+ return (+ <div+ className={cn(+ "flex flex-wrap gap-4 lg:flex-col lg:items-start",+ className,+ )}+ >+ {/* Environment Labeling for Langfuse Maintainers */}+ {showEnvLabel && <EnvLabel />}+ {/* Langfuse Logo */}+ <div className="flex items-center">+ <Link href="/" className="flex items-center">+ <LangfuseLogotypeOrCustomized size={size} />+ </Link>+ {version && <VersionLabel className="ml-2" />}+ </div></div>- </div>-);+ );+};diff --git a/web/src/components/layouts/layout.tsx b/web/src/components/layouts/layout.tsxindex b321647eeb..6b52966a97 100644--- a/web/src/components/layouts/layout.tsx+++ b/web/src/components/layouts/layout.tsx@@ -577,6 +577,8 @@ const MainNavigation: React.FC<{{},);+ const uiCustomization = useUiCustomization();+return (<li className={className}><ul role="list" className="-mx-2 space-y-1">@@ -594,34 +596,44 @@ const MainNavigation: React.FC<{onClick={onNavitemClick}target={item.newTab ? "_blank" : undefined}>- {item.icon && (- <item.icon- className={clsx(- item.current- ? "text-primary-accent"- : "text-muted-foreground group-hover:text-primary-accent",- "h-5 w-5 shrink-0",+ {item.pathname === "/" &&+ uiCustomization?.logoLightModeHref &&+ uiCustomization?.logoDarkModeHref ? (+ // override the default logo with the uiCustomization logo if the pathname is "/"+ <LangfuseLogo size="sm" version />+ ) : (+ // default node for all other routes+ <>+ {item.icon && (+ <item.icon+ className={clsx(+ item.current+ ? "text-primary-accent"+ : "text-muted-foreground group-hover:text-primary-accent",+ "h-5 w-5 shrink-0",+ )}+ aria-hidden="true"+ />)}- aria-hidden="true"- />+ {item.name}+ {item.label &&+ (typeof item.label === "string" ? (+ <span+ className={cn(+ "-my-0.5 self-center whitespace-nowrap break-keep rounded-sm border px-1 py-0.5 text-xs",+ item.current+ ? "border-primary-accent text-primary-accent"+ : "border-border text-muted-foreground group-hover:border-primary-accent group-hover:text-primary-accent",+ )}+ >+ {item.label}+ </span>+ ) : (+ // ReactNode+ item.label+ ))}+ </>)}- {item.name}- {item.label &&- (typeof item.label === "string" ? (- <span- className={cn(- "-my-0.5 self-center whitespace-nowrap break-keep rounded-sm border px-1 py-0.5 text-xs",- item.current- ? "border-primary-accent text-primary-accent"- : "border-border text-muted-foreground group-hover:border-primary-accent group-hover:text-primary-accent",- )}- >- {item.label}- </span>- ) : (- // ReactNode- item.label- ))}</Link>) : item.children && item.children.length > 0 ? (<Disclosurediff --git a/web/src/components/layouts/routes.tsx b/web/src/components/layouts/routes.tsxindex 3f75c07e6e..bbf2a247f7 100644--- a/web/src/components/layouts/routes.tsx+++ b/web/src/components/layouts/routes.tsx@@ -48,6 +48,7 @@ export const ROUTES: Route[] = [pathname: "/",icon: LangfuseIcon,label: <VersionLabel className="-ml-3" />,+ // node is overridden in layout.tsx if uiCustomization.logoLightModeHref and uiCustomization.logoDarkModeHref are set},{name: "Projects",diff --git a/web/src/ee/features/ui-customization/uiCustomizationRouter.ts b/web/src/ee/features/ui-customization/uiCustomizationRouter.tsindex 8e1ce0eefd..bb40e07929 100644--- a/web/src/ee/features/ui-customization/uiCustomizationRouter.ts+++ b/web/src/ee/features/ui-customization/uiCustomizationRouter.ts@@ -10,6 +10,8 @@ export const uiCustomizationRouter = createTRPCRouter({documentationHref: env.LANGFUSE_UI_DOCUMENTATION_HREF,supportHref: env.LANGFUSE_UI_SUPPORT_HREF,feedbackHref: env.LANGFUSE_UI_FEEDBACK_HREF,+ logoLightModeHref: env.LANGFUSE_UI_LOGO_LIGHT_MODE_HREF,+ logoDarkModeHref: env.LANGFUSE_UI_LOGO_DARK_MODE_HREF,};}),});diff --git a/web/src/env.mjs b/web/src/env.mjsindex ebd03ebfbd..0d6e6eab3a 100644--- a/web/src/env.mjs+++ b/web/src/env.mjs@@ -120,6 +120,8 @@ export const env = createEnv({LANGFUSE_UI_DOCUMENTATION_HREF: z.string().url().optional(),LANGFUSE_UI_SUPPORT_HREF: z.string().url().optional(),LANGFUSE_UI_FEEDBACK_HREF: z.string().url().optional(),+ LANGFUSE_UI_LOGO_LIGHT_MODE_HREF: z.string().url().optional(),+ LANGFUSE_UI_LOGO_DARK_MODE_HREF: z.string().url().optional(),// EE LicenseLANGFUSE_EE_LICENSE_KEY: z.string().optional(),ADMIN_API_KEY: z.string().optional(),@@ -309,6 +311,8 @@ export const env = createEnv({LANGFUSE_UI_DOCUMENTATION_HREF: process.env.LANGFUSE_UI_DOCUMENTATION_HREF,LANGFUSE_UI_SUPPORT_HREF: process.env.LANGFUSE_UI_SUPPORT_HREF,LANGFUSE_UI_FEEDBACK_HREF: process.env.LANGFUSE_UI_FEEDBACK_HREF,+ LANGFUSE_UI_LOGO_LIGHT_MODE_HREF: process.env.LANGFUSE_UI_LOGO_LIGHT_MODE_HREF,+ LANGFUSE_UI_LOGO_DARK_MODE_HREF: process.env.LANGFUSE_UI_LOGO_DARK_MODE_HREF,// EE LicenseLANGFUSE_EE_LICENSE_KEY: process.env.LANGFUSE_EE_LICENSE_KEY,ADMIN_API_KEY: process.env.ADMIN_API_KEY,