feat(whitelabel): add in the ability to whitelabel via envvars#887
feat(whitelabel): add in the ability to whitelabel via envvars#887waleedlatif1 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Greptile Summary
This PR introduces comprehensive whitelabeling functionality that allows organizations to customize the application's branding through environment variables. The implementation enables runtime configuration of brand elements including company name, logo, colors, custom CSS, support URLs, and legal page links without requiring code changes.
The changes span multiple layers of the application:
Environment Configuration: Adds 15 new client-side environment variables in env.ts with proper Zod validation for brand customization (name, logo URLs, colors, support email, documentation URLs, etc.)
Core Branding System: Introduces a new branding module (lib/branding/branding.ts) that provides getBrandConfig() and useBrandConfig() functions to access brand configuration with fallbacks to default 'Sim' values
Email Templates: Updates all email components (invitation, password reset, OTP verification, workspace invitation, batch invitation, footer) to use dynamic branding instead of hardcoded 'Sim' references
UI Components: Modifies navigation, authentication layout, and search modal to display custom logos and documentation URLs based on environment variables
Layout & Metadata: Implements BrandedLayout component for global brand application and dynamic metadata generation for SEO and PWA manifest with brand-specific values
Helm Configuration: Adds comprehensive whitelabel configuration examples in values.yaml and values-whitelabeled.yaml for Kubernetes deployments
The architecture uses NEXT_PUBLIC_* prefixed environment variables to ensure client-side availability while maintaining backward compatibility through fallback patterns. This enables the same codebase to be deployed with different branding configurations, particularly useful for enterprise customers and multi-tenant deployments.
Confidence score: 2/5
- This PR introduces significant functionality but contains several critical issues that could cause production problems
- Score reflects environment variable validation gaps, security concerns with CSS injection, and inconsistent branding implementation in structured data
- Pay close attention to
lib/branding/branding.ts,lib/branding/metadata.ts,components/branded-layout.tsx, and the Helm values files
18 files reviewed, 6 comments
* feat(whitelabel): add in the ability to whitelabel via envvars * restore site.webmanifest * fix(dynamic): remove force-dynamic from routes that don't need it (#888) * Reinstall dependencies * Update docs
…udioai#887) * feat(whitelabel): add in the ability to whitelabel via envvars * restore site.webmanifest * fix(dynamic): remove force-dynamic from routes that don't need it (simstudioai#888) * Reinstall dependencies * Update docs
Summary
Add in the ability to whitelabel via envvars
Type of Change
Testing
N/A
Checklist