Migration Notes
Move from deprecated Coframe command forms to the current API
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 command forms listed on this page are deprecated but continue to work. Migrate when convenient — there is no planned removal date. For the full current command reference, see CFQ Commands.
01CFQ command migrations
The following window.CFQ command forms were deprecated as of January 2026.
Each deprecated form still works; the modern equivalents are preferred for all
new code.
emit: 'pageHydrated' → pageHydrated: true
The emit form of the hydration signal has been replaced by a direct field.
Before (deprecated)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ emit: 'pageHydrated' });
</script>After (preferred)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ pageHydrated: true });
</script>emit: 'conversion' → conversion
The emit form of a manual conversion event has been replaced by a top-level
conversion key. The payload moves from the payload property to the
conversion value directly.
Before (deprecated)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
emit: 'conversion',
payload: {
metricId: 'metric_abc',
value: 99
}
});
</script>After (preferred)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
conversion: {
metricId: 'metric_abc',
value: 99
}
});
</script>emit: { featureFlagSet } → featureFlagSet
The nested emit object form of the feature flag signal has been replaced by a
direct top-level field.
Before (deprecated)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ emit: { featureFlagSet: true } });
</script>After (preferred)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ featureFlagSet: true });
</script>callback / bulkCallback → bulkCallbackV2
The single-treatment callback and bulk bulkCallback fields on a
subscribe: 'treatmentApplied' command are deprecated in favour of
bulkCallbackV2. The preferred callback receives two arguments: an array of
CoframeTreatmentDataV2 objects and an array of raw experiment info records.
Before — callback (deprecated)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
callback: (treatment) => {
analytics.track('Experiment Viewed', {
experiment_id: treatment.coframe_experiment_id,
variant_id: treatment.coframe_variant_id,
});
}
});
</script>Before — bulkCallback (deprecated)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
bulkCallback: (treatments) => {
treatments.forEach(t =>
analytics.track('Experiment Viewed', {
experiment_id: t.coframe_experiment_id,
variant_id: t.coframe_variant_id,
})
);
}
});
</script>After — bulkCallbackV2 (preferred)
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
bulkCallbackV2: (treatments, rawIds) => {
treatments.forEach(t =>
analytics.track('Experiment Viewed', {
experiment_id: t.coframe_experiment_id,
variant_id: t.coframe_variant_id,
})
);
}
});
</script>02enableAntiFlickering config field
The enableAntiFlickering field is declared on CoframeConfig but has no
runtime effect — it is not read anywhere in the SDK or edge worker. Setting it
to true or false does not change SDK behaviour.
Anti-flicker is handled automatically by the install script. The generated
snippet injects a CSS style block that hides the page immediately on load and
removes it once the SDK finishes initialising (or after config.timeoutMs,
whichever comes first). No configuration flag is required to enable this
behaviour.
If your config object already contains enableAntiFlickering, you can leave it
in place or remove it — the SDK behaves identically either way.
See Config Reference and SDK Options for the fields that do have a runtime effect.
# Migration Notes
Move from deprecated Coframe command forms to the current API
The command forms listed on this page are deprecated but continue to work.
Migrate when convenient — there is no planned removal date. For the full
current command reference, see [CFQ Commands](../docs/cfq-commands.html).
## CFQ command migrations
The following `window.CFQ` command forms were deprecated as of January 2026.
Each deprecated form still works; the modern equivalents are preferred for all
new code.
`emit: 'pageHydrated'` → `pageHydrated: true`
The `emit` form of the hydration signal has been replaced by a direct field.
Before (deprecated)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ emit: 'pageHydrated' });
</script>
```
After (preferred)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ pageHydrated: true });
</script>
```
`emit: 'conversion'` → `conversion`
The `emit` form of a manual conversion event has been replaced by a top-level
`conversion` key. The payload moves from the `payload` property to the
`conversion` value directly.
Before (deprecated)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
emit: 'conversion',
payload: {
metricId: 'metric_abc',
value: 99
}
});
</script>
```
After (preferred)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
conversion: {
metricId: 'metric_abc',
value: 99
}
});
</script>
```
`emit: { featureFlagSet }` → `featureFlagSet`
The nested `emit` object form of the feature flag signal has been replaced by a
direct top-level field.
Before (deprecated)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ emit: { featureFlagSet: true } });
</script>
```
After (preferred)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({ featureFlagSet: true });
</script>
```
`callback` / `bulkCallback` → `bulkCallbackV2`
The single-treatment `callback` and bulk `bulkCallback` fields on a
`subscribe: 'treatmentApplied'` command are deprecated in favour of
`bulkCallbackV2`. The preferred callback receives two arguments: an array of
`CoframeTreatmentDataV2` objects and an array of raw experiment info records.
Before — `callback` (deprecated)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
callback: (treatment) => {
analytics.track('Experiment Viewed', {
experiment_id: treatment.coframe_experiment_id,
variant_id: treatment.coframe_variant_id,
});
}
});
</script>
```
Before — `bulkCallback` (deprecated)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
bulkCallback: (treatments) => {
treatments.forEach(t =>
analytics.track('Experiment Viewed', {
experiment_id: t.coframe_experiment_id,
variant_id: t.coframe_variant_id,
})
);
}
});
</script>
```
After — `bulkCallbackV2` (preferred)
HTML
```
<script>
window.CFQ = window.CFQ || [];
window.CFQ.push({
subscribe: 'treatmentApplied',
bulkCallbackV2: (treatments, rawIds) => {
treatments.forEach(t =>
analytics.track('Experiment Viewed', {
experiment_id: t.coframe_experiment_id,
variant_id: t.coframe_variant_id,
})
);
}
});
</script>
```
## enableAntiFlickering config field
The `enableAntiFlickering` field is declared on `CoframeConfig` but has no
runtime effect — it is not read anywhere in the SDK or edge worker. Setting it
to `true` or `false` does not change SDK behaviour.
Anti-flicker is handled automatically by the install script. The generated
snippet injects a CSS style block that hides the page immediately on load and
removes it once the SDK finishes initialising (or after `config.timeoutMs`,
whichever comes first). No configuration flag is required to enable this
behaviour.
If your config object already contains `enableAntiFlickering`, you can leave it
in place or remove it — the SDK behaves identically either way.
See [Config Reference](../docs/config-reference.html) and
[SDK Options](../docs/sdk-options.html) for the fields that do have a
runtime effect.
## Related
- [CFQ Commands](../docs/cfq-commands.html) — full current command reference, including the deprecated aliases table
- [Config Reference](../docs/config-reference.html) — all `CoframeConfig` fields and their effects
- [SDK Options](../docs/sdk-options.html) — hydration, consent, feature flag, and timeout settings