Admin
Build-Time Parameters
Learn how to pass build-time configuration values into Admin components using Admin.BuildParam and useBuildParams.
- how to register a build-time parameter in
webiny.config.tsx - how to access it in React components and hooks via
useBuildParams - how to access it in non-React Admin code via
BuildParams
Overview
BuildParams is the mechanism for passing configuration values — determined at build time — into the Admin application. Values are registered in webiny.config.tsx using Admin.BuildParam and embedded directly into the Admin bundle during the build step. Inside React components and hooks, they are accessed via the useBuildParams hook. In non-React Admin code (services, class-based extensions), inject BuildParams directly via dependency injection.
Registering a Parameter
Declare parameters in webiny.config.tsx using Admin.BuildParam:
The value can be a string, number, boolean, object, or array.
Accessing Parameters in a Component
Use the useBuildParams hook anywhere in the Admin React tree:
params.get<T>(key) returns the value typed as T, or null if the key was not registered.
You can also call useBuildParams inside a custom hook:
Accessing Parameters in Non-React Code
In class-based Admin extensions (services, event handlers, use cases), inject BuildParams via the constructor:
Deploying
After adding or changing an Admin.BuildParam, rebuild and redeploy the Admin app:
During development, rerunning watch is enough — no full deploy needed: