Skip to main content

Advanced Rebranding

Extending the rebrand engine for custom requirements.

Overview​

While the built-in rebrand engine covers most use cases, you may need to extend it to handle custom assets, additional string replacements, or complex feature toggling.

Extending the Engine​

1. Custom String Replacements​

You can add additional search-and-replace patterns to the build-rebrand.sh script. Look for the section labeled # String Replacement and add your own sed commands:

# Example: Replace a custom placeholder
find . -type f -name "*.tsx" -exec sed -i 's/CUSTOM_PLACEHOLDER/MyValue/g' {} +

2. Custom Asset Injection​

If you have additional assets (e.g., custom fonts or extra icons), you can add a copy command to the # Asset Management section:

# Example: Copy custom fonts
cp -r ../../../rebrand/assets/fonts/* ./public/fonts/

3. Hooking into the Build Process​

The rebrand engine provides hooks (or you can add them) to run custom scripts before or after the main rebranding steps.

Multi-Client Deployments​

For agencies managing multiple clients, you can create separate settings files (e.g., settings-client-a.md, settings-client-b.md) and pass them as arguments to the rebrand script:

./scripts/build-rebrand.sh --config rebrand/settings-client-a.md

Best Practices​

  • ✅ Do this: Use version control to track your changes to the rebrand engine scripts.
  • ✅ Do this: Test your extensions on a small subset of files before running them on the entire codebase.
  • ❌ Don't do this: Hardcode client-specific values in the engine scripts; always use the configuration file.