Skip to content

Installation

Create a new experiment

Run the create command with your project name:

bash
npx @sogody/experiment-framework my-experiment

The CLI asks a few setup questions, creates the project, and installs its dependencies. It can also configure Playwright and run an initial smoke test.

CLI prompts

PromptDefaultWhat it controls
Number of variations1Generates src/js/v1/ through src/js/vN/. Pick 2 for A/B, 3 for A/B/C.
Window namespacesgdThe IIFE output name on window, such as window.sgd. It must be a valid JavaScript identifier. Change it only if another experiment on the page uses the same name.
Include emergency braketrueSets runtime.includeEmergencyBrake in experiment.config.js. When enabled, runScript() checks the Adobe Target emergency-brake configuration before running the experiment.
Enable E2E testingfalseGenerates e2e/, playwright.config.js, and wires up pnpm test:e2e. Enable if you have a stable preview URL to test against.
Base URL (E2E only)https://samsung.comThe root URL for Playwright tests.
Market (E2E only)-Selects which Samsung market(s) to parametrise tests against. See the Markets reference.
Run smoke test (E2E only)falseRuns pnpm build and pnpm test:e2e immediately after setup.

After scaffolding

After scaffolding, start the watcher for the first variation:

bash
cd my-experiment

# Watch variation 1 - rebuilds on save and copies IIFE to clipboard
pnpm start 0

Paste the copied bundle into the matching Adobe Target variation, save, and refresh the preview.

Optional AI project support

Generated projects do not include AI instruction files automatically. From the project root, create the instruction file your tool uses:

bash
pnpm init-claude
pnpm init-agents

The commands create CLAUDE.md and AGENTS.md after inferring the experiment name and E2E setup from the scaffolded project.

See AI Project Support for generated paths, replacement behavior, and older-project usage.

Current scaffold

The CLI now generates one generic button template. Add experiment-specific data loading or custom components in the generated project when needed.

Existing directories

If the destination directory already exists and is not empty, the CLI asks before continuing. It does not remove unrelated files from that directory.

Internal tool - Samsung / Sogody experimentation team

Help improve the frameworkShare an idea or friction you encountered.Share framework feedback(opens in a new tab)