Skip to content
Brok UI

Loading…

No results

Safe experimentation

Brok gives unstable design-system work a separate path. Product teams can also use deterministic feature flags for a controlled rollout.

What "unstable" means

Every item carries a stability: experimental and incubating items can change their API on any version increase and install into an experimental namespace; stable items follow semantic versioning; deprecated items name their replacement and removal horizon. The CLI shows the state and a feedback URL before it installs or updates an unstable item. How items are promoted and retired is documented with the registry lifecycle.

Install an unstable item

terminal
php artisan ui:show pro/docx-editor
php artisan ui:add pro/docx-editor --dry-run
php artisan ui:add pro/docx-editor --accept-unstable
php artisan ui:update pro/docx-editor --accept-unstable

The command shows the lifecycle state and feedback URL. A non-interactive install or update needs the explicit opt-in flag.

Product feature flags

The package has an off-by-default kill switch, stable subject assignment, percentage rollout, allow and deny lists, schedules, and weighted variants.

config/ui.php PHP
'experiments' => [
    'enabled' => env('BROK_EXPERIMENTS_ENABLED', false),
    'salt' => env('BROK_EXPERIMENT_SALT', ''),
    'definitions' => [
        'new-checkout' => [
            'enabled' => true,
            'rollout' => 10,
            'allow' => [],
            'deny' => [],
            'starts_at' => '2026-09-01T00:00:00Z',
            'ends_at' => '2026-09-15T00:00:00Z',
            'variants' => ['control' => 50, 'treatment' => 50],
        ],
    ],
],
resources/views/checkout.blade.php Blade
@brokExperiment('new-checkout', $user->getAuthIdentifier())
    <x-checkout.experimental />
@elsebrokExperiment
    <x-checkout.current />
@endbrokExperiment

Listen for ExperimentEvaluated to count exposures and outcomes. The event contains a salted subject fingerprint, not the raw subject ID.