Segmently CLI Paywall A/B Rollout
Use this skill for the reusable sandbox paywall A/B scenario. It is an automation wrapper around the CLI facade, not a new product API. It supports two rollout modes:
funnelManifest: create two new onboarding variants from inline manifests.clonedFunnelVersion: keep an existing source funnel as control, clone the source version into a treatment funnel, mutate one Paywall screen's product list, publish both placements, and publish the A/B test.
Preconditions
- Run from the installed skill directory or pass the script path explicitly.
- Confirm the public Segmently CLI is installed and authenticated:
segmently auth status - If the CLI reports
auth_required, runsegmently auth login --env <env>for the intended environment and retry aftersegmently auth status --env <env>succeeds. - Use a cloned/test funnel and Stripe sandbox/test account unless the user has explicitly approved the target production experiment.
- Minimum target context for clone-based rollout is: project id, source funnel
id, source version/draft id, paywall screen id or confirmation to use the
default
Paywallscreen, treatment product ids or approval to create sandbox products, and explicit approval before publishing A/B traffic. - The authenticated CLI identity must include:
projects:read,funnels:read,funnels:write,themes:read,themes:write,publish:write,stripe:read,stripe:write. - The project must have a connected Stripe sandbox/test account.
- Prefer an active project theme. If the project has no active theme, run
segmently themes list/global/import/set-activefirst.
Canonical Command
node scripts/run-paywall-ab-rollout.mjs \
--project <projectId>Useful options:
--suffix <stable-id> # deterministic aliases for reruns
--paywall-product-id <id> # reuse an existing Segmently paywall product
--source-funnel-id <id> # enable clonedFunnelVersion mode
--source-version-id <id> # source version to clone
--source-web-placement-alias <a> # optional source onboarding URL in summary
--paywall-screen-id <id> # screen key/id to mutate, default Paywall
--clone-name <name> # treatment funnel name
--clone-version-name <name> # treatment version name
--treatment-paywall-product-ids <ids>
# comma-separated treatment product ids
--probe-samples <count> # default 30
--public-base-url <url> # default comes from CLI env
--output <path> # write the final summary JSONWhat The Script Does
Default funnelManifest mode:
- Ensures a Stripe test-mode paywall product unless
--paywall-product-idis supplied. - Builds two inline
funnelManifestvariants:- control: goal -> name -> email -> paywall -> paid success
- treatment: same variable and paywall contract with different copy
- Runs:
segmently ab-tests rollout apply --publish --probe - Returns the control URL, treatment URL, A/B URL, paywall product id, publication id, and probe results as JSON.
clonedFunnelVersion mode:
- Requires
--source-funnel-idand--source-version-id. - Ensures one Stripe test-mode treatment paywall product unless
--paywall-product-idor--treatment-paywall-product-idsis supplied. - Builds a rollout manifest with:
- control:
existingFunnelVersionfrom the source funnel/version. - treatment:
clonedFunnelVersionfrom the same source funnel/version.
- control:
- Mutates
--paywall-screen-idin the treatment clone through the backendSimplifiedV2ScreenAdapter, preserving the source funnel unchanged. - Publishes the generated control placement, treatment placement, and A/B placement, then probes the public A/B URL.
- Returns source editor URL, optional source public URL, control/treatment onboarding URLs, treatment clone editor URL, A/B URL, publication id, and probe results as JSON.
Example clone run:
node scripts/run-paywall-ab-rollout.mjs \
--project <projectId> \
--source-funnel-id <funnelId> \
--source-version-id <versionId> \
--source-web-placement-alias <existing-source-alias> \
--paywall-screen-id Paywall \
--clone-name "Paywall Product Treatment"Safety Rules
- The wrapper is sandbox-only for Stripe product creation. It always sends
mode: "test"tostripe paywall-product ensure. - The wrapper must not print API keys, tokens, refresh tokens, or credentials.
- Use
--paywall-product-idwhen you need to avoid creating another Stripe product. - In clone mode, the source funnel/version is used read-only; the Paywall mutation is applied only to the treatment clone.
- Do not use this wrapper for production traffic experiments without a separate product rollout review.
- If runtime probe fails, inspect the JSON output first. The created artifacts are intentionally left in place for debugging and reruns.
Verification
Minimum local smoke:
node --check scripts/run-paywall-ab-rollout.mjs
node scripts/run-paywall-ab-rollout.mjs --helpFull verification against a customer-approved test project:
node scripts/run-paywall-ab-rollout.mjs \
--project <projectId> \
--source-funnel-id <funnelId> \
--source-version-id <versionId> \
--probe-samples 30 \
--output checks/paywall-ab-rollout-summary.jsonRelated CLI Surfaces
segmently stripe paywall-product ensuresegmently themes list/global/import/set-activesegmently ab-tests rollout apply --publish --probesource.type = "existingFunnelVersion"source.type = "clonedFunnelVersion"/api/cli/v1/projects/:projectId/stripe/paywall-products/ensure/api/cli/v1/projects/:projectId/ab-tests/rollout/apply