Skip to main content

Company Branding Logo

Overview

Tower displays the customer's company logo (from BCYIP) on the login screen and in the sidebar, always reflecting the live company.customization.logo from the BCYIP API — no stale copy stored in the activation token.

How it works

  1. A public GET /api/v1/branding endpoint reads the stored activation bearer, calls BCYIP GET /user, normalises the customization.logo (Mongoose buffer JSON, various encodings) to a data URL, and returns { logoDataUrl }.
  2. On any failure or missing logo, logoDataUrl: null is returned with HTTP 200 so the UI falls back to the default SVG.
  3. The frontend BrandingLogo component fetches via branding.api.ts (axios without Tower session), using React Query with a 3-minute staleTime and refetchOnWindowFocus: true.

Key files

  • src/protocol/bcyip/company-logo.ts — Logo normalisation logic
  • src/protocol/bcyip/api.tsfetchCompanyBranding
  • src/app.controller.ts — Public GET /api/v1/branding route
  • ui/src/protocol/branding.api.ts — Axios call (no Tower session)
  • ui/src/components/atoms/BrandingLogo.tsx — React component
  • ui/src/pages/login/login.tsx — Logo integration on login screen
  • ui/src/components/layout/Sidenav.tsx — Logo integration in sidebar

Technical decisions

  • tower.api uses a local session key string aligned with BCYIP_TOKEN_KEY in login.tsx to avoid a circular import.
  • The endpoint is public (no Tower JWT) so the logo is visible before login.

Known issues

  • Logo is cached for 3 minutes client-side. Changes in BCYIP admin take up to 3 minutes or a window focus to propagate.