Parameter types
Every parameter has a type that determines what values it can hold.- String
- Number
- Boolean
- JSON
Namespaces
Parameter keys use dot notation to create logical groupings:.traffical/config.yaml and onto how the dashboard displays them. Group related parameters under a shared prefix so they stay together.
Default values
Every parameter has a default. The SDK returns the default whenever no policy overrides it for the current user — and as a safety net when the bundle hasn’t loaded yet or Traffical is unreachable. Defaults appear in two places:- In Traffical — the canonical value, set in the dashboard or via the CLI.
- In your code — a fallback you pass into
getParams. This is what your application sees if no bundle is available at all (first call before the network completes, offline, etc.).
Constraints
Parameters can declare optional constraints. They’re enforced at edit time (in the dashboard and intraffical push) but not at SDK resolution.
| Constraint | Applies to | Description |
|---|---|---|
min | number | Minimum allowed value |
max | number | Maximum allowed value |
pattern | string | Regex that values must match |
allowedValues | string, number | Enum of permitted values |
Config-as-code
Parameters can live in.traffical/config.yaml alongside your application code and sync with Traffical via the CLI:
traffical push to sync. Parameters managed via the CLI are marked as synced in the dashboard — their definitions become read-only in the UI to prevent drift between your repo and the platform. Policies and allocations still live in the dashboard; the CLI manages parameter definitions and event schemas.
How parameters relate to other concepts
- Layers — every parameter belongs to exactly one layer. Layers exist so concurrent experiments don’t interfere.
- Policies — policies override parameter defaults for users matching their conditions and falling in their bucket ranges.
- Events — track events let the optimization engine learn which parameter values perform best.