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
- A public
GET /api/v1/brandingendpoint reads the stored activation bearer, calls BCYIPGET /user, normalises thecustomization.logo(Mongoose buffer JSON, various encodings) to a data URL, and returns{ logoDataUrl }. - On any failure or missing logo,
logoDataUrl: nullis returned with HTTP 200 so the UI falls back to the default SVG. - The frontend
BrandingLogocomponent fetches viabranding.api.ts(axios without Tower session), using React Query with a 3-minutestaleTimeandrefetchOnWindowFocus: true.
Key files
src/protocol/bcyip/company-logo.ts— Logo normalisation logicsrc/protocol/bcyip/api.ts—fetchCompanyBrandingsrc/app.controller.ts— PublicGET /api/v1/brandingrouteui/src/protocol/branding.api.ts— Axios call (no Tower session)ui/src/components/atoms/BrandingLogo.tsx— React componentui/src/pages/login/login.tsx— Logo integration on login screenui/src/components/layout/Sidenav.tsx— Logo integration in sidebar
Technical decisions
tower.apiuses a local session key string aligned withBCYIP_TOKEN_KEYinlogin.tsxto 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.