Environments
How to test Coframe changes safely without affecting live visitors
Copy this guide and your current settings as a prompt for your AI agent.
Preview agent promptSee the guide, code and settings included when you copy.
The Coframe SDK does not have a built-in staging or production mode. There is no
environment switch, no per-environment endpoint, and no second projectId for a
staging deployment. A project is simply identified by its projectId; the same
install script runs across your site.
To test changes safely — without affecting live visitors or polluting experiment data — use the preview and disable controls built into the install script and browser SDK.
01Testing without affecting production
Disable Coframe for a session. Append ?cf_disabled (or any string
containing cf_disable) to any page URL. The install-script IIFE exits before
the SDK is fetched or executed, so no variants are applied and no events are
sent. Use this to get a clean baseline page-load measurement or to verify your
site works correctly when Coframe is inactive.
Preview a specific variant. Append ?coframe_variant_id=<variant_id> to a
page URL. The edge worker serves a preview version of the project built from that
variant, and the browser SDK sets isPreviewVariant = true, which suppresses
event sending so the preview session does not appear in live experiment data.
Force events in preview when needed. If you also need to verify that
analytics hooks fire correctly while previewing, add
&coframe_should_send_events=true. This overrides the preview event gate and
sends events normally — use this in a controlled QA environment, not against
your production experiment.
For step-by-step instructions and URL examples, see Preview and Debugging.
02Project identification
Every Coframe install is tied to a projectId set in the config block of the
installation script. The SDK uses this value as the key to fetch project data
from the edge and to tag the events it sends. There is one projectId per
project; the same value appears in every copy of your install script.
See Config Reference for the full
CoframeConfig field list and JavaScript Installation
for the standard install script.
# Environments How to test Coframe changes safely without affecting live visitors The Coframe SDK does not have a built-in staging or production mode. There is no environment switch, no per-environment endpoint, and no second `projectId` for a staging deployment. A project is simply identified by its `projectId`; the same install script runs across your site. To test changes safely — without affecting live visitors or polluting experiment data — use the preview and disable controls built into the install script and browser SDK. ## Testing without affecting production Disable Coframe for a session. Append `?cf_disabled` (or any string containing `cf_disable`) to any page URL. The install-script IIFE exits before the SDK is fetched or executed, so no variants are applied and no events are sent. Use this to get a clean baseline page-load measurement or to verify your site works correctly when Coframe is inactive. Preview a specific variant. Append `?coframe_variant_id=<variant_id>` to a page URL. The edge worker serves a preview version of the project built from that variant, and the browser SDK sets `isPreviewVariant = true`, which suppresses event sending so the preview session does not appear in live experiment data. Force events in preview when needed. If you also need to verify that analytics hooks fire correctly while previewing, add `&coframe_should_send_events=true`. This overrides the preview event gate and sends events normally — use this in a controlled QA environment, not against your production experiment. For step-by-step instructions and URL examples, see [Preview and Debugging](../docs/preview-and-debug.html). ## Project identification Every Coframe install is tied to a `projectId` set in the `config` block of the installation script. The SDK uses this value as the key to fetch project data from the edge and to tag the events it sends. There is one `projectId` per project; the same value appears in every copy of your install script. See [Config Reference](../docs/config-reference.html) for the full `CoframeConfig` field list and [JavaScript Installation](../docs/javascript.html) for the standard install script. ## Related - [Preview and Debugging](../docs/preview-and-debug.html) — `?cf_disabled`, `coframe_variant_id`, `coframe_should_send_events` - [Config Reference](../docs/config-reference.html) — `projectId`, `currentUrl`, and all other config fields - [JavaScript Installation](../docs/javascript.html) — the standard install script - [Testing and Validation](../docs/testing-and-validation.html) — pre-launch checklist