ERP B2B Premium supports complete white-label branding per tenant. Each tenant’s public site displays their own logo, primary color, favicon, and company name — loaded dynamically fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ency07/B2B/llms.txt
Use this file to discover all available pages before exploring further.
tenant_settings at request time. No redeployment is required to change branding.
How Branding Is Applied
The public layout callsgetPublicTenantSettings(tenantCode) server-side during rendering. Because this action requires no authentication, it runs safely inside Next.js generateMetadata and root layout Server Components. The returned branding object is passed to the layout as CSS variables and page metadata.
When a tenant has not yet configured branding settings, getBrandingDefaults(tenantCode) in src/platform/branding/branding-defaults.ts supplies hardcoded fallback values for known tenant codes. This prevents blank pages and broken layouts during initial tenant provisioning.
The full branding write path (used by the admin UI) goes through saveTenantBranding in src/web/actions/branding.ts, which:
- Upserts all changed keys into
tenant_settingswithis_public: true, automatically assigning each key to its correct module (EMPRESA,IDENTIDAD,LOCALIZACION, orDOCUMENTOS). - Takes a full branding snapshot and stores it as a new row in
tenant_branding_version.
restoreBrandingVersion.
Branding Server Actions
All branding actions live insrc/web/actions/branding.ts and are marked "use server".
| Action | Permission Required | Description |
|---|---|---|
getTenantBranding(tenantCode?) | — | Return the consolidated BrandingConfig for a tenant |
saveTenantBranding(tenantCode, data, description?) | branding.manage | Upsert branding keys and snapshot to version history |
getBrandingHistory(tenantCode?) | — | List all BrandingVersion snapshots, newest first |
restoreBrandingVersion(tenantCode, versionId) | branding.manage | Re-apply a historical snapshot and log a new version entry |
uploadBrandingLogo(tenantCode, fileType, base64Data, fileName, mimeType) | branding.manage | Upload an image to the tenant-logos Storage bucket and return its public URL |
getPublicBranding(tenantCode?) | — | Alias for getTenantBranding; safe for unauthenticated contexts |
saveTenantBranding
BrandingConfig object. Only the keys present in data are upserted — other keys are left unchanged. After the upsert, a full snapshot of the active branding config is written to tenant_branding_version.
getBrandingHistory
BrandingVersion objects ordered newest-first:
restoreBrandingVersion
config_values back into tenant_settings, then creates a new version entry with a description referencing the restored version number.
uploadBrandingLogo
tenant-logos Storage bucket (created automatically if it does not exist) and returns the public URL. Store the returned url value in the matching config_key row via saveTenantBranding.
Branding Configuration Checklist
Set the commercial name
Call
saveTenantBranding with { nombre_comercial: "..." }. This key is stored under module EMPRESA and is the display name shown in the navigation header and page titles.Upload and set logos
Call
uploadBrandingLogo with your image data, then pass the returned URL to saveTenantBranding as { logo_url: "..." } (light background) and/or { logo_secondary_url: "..." } (dark background).Upload and set the favicon
Upload a
.ico, .png, or .svg file with uploadBrandingLogo, then save the URL as { favicon_url: "..." }. This appears in the browser tab and bookmarks.Set brand colors
Call
saveTenantBranding with { primary_color: "#1A2B3C", secondary_color: "#F59E0B" }. These are injected as CSS custom properties and control buttons, highlights, and accent elements across the UI.Set browser metadata
Set
titulo_navegador for the <title> tag and descripcion_sitio for the <meta name="description"> tag. Both are used by Next.js generateMetadata at request time.Branding Keys Reference
These are the nine keys fetched bygetPublicTenantSettings and used by the public layout. The Module column reflects how saveTenantBranding categorises each key internally.
| Key | Module | Description | Example |
|---|---|---|---|
nombre_comercial | EMPRESA | Display name shown in the UI | "Acerías del Caribe" |
razon_social | EMPRESA | Legal name used on documents and invoices | "Acerías del Caribe S.A." |
logo_url | IDENTIDAD | Primary logo for light backgrounds | Supabase Storage public URL |
logo_secondary_url | IDENTIDAD | Secondary logo for dark backgrounds | Supabase Storage public URL |
favicon_url | IDENTIDAD | Browser tab favicon | Supabase Storage public URL |
primary_color | IDENTIDAD | Primary brand color | #1A2B3C |
secondary_color | IDENTIDAD | Accent / secondary brand color | #F59E0B |
titulo_navegador | IDENTIDAD | Browser <title> tag content | "Acerías B2B Portal" |
descripcion_sitio | IDENTIDAD | Page <meta name="description"> content | "Portal industrial..." |
Branding Version History
Every call tosaveTenantBranding automatically snapshots the full active branding config into the tenant_branding_version table. You can retrieve the version list with getBrandingHistory(tenantCode) and roll back any version with restoreBrandingVersion(tenantCode, versionId). A rollback itself creates a new version entry describing the restoration, preserving a complete audit trail.
Fallback Behavior
If a tenant has no rows intenant_settings for branding keys, getBrandingDefaults(tenantCode) returns hardcoded defaults for known tenant codes defined in src/platform/branding/branding-defaults.ts. This ensures the layout renders correctly before a tenant has completed their branding setup. Once real settings are saved, they take precedence over the defaults on every subsequent request.