Flags
Read a flag
One call on the theme, a header on headless.
For in-house engineers
CSS and JavaScript per group, feature flags, Next.js and Cloudflare installs, a dataLayer event and an API with scoped keys.
import { croMiddleware } from "@growthdept/cro-runtime/headless"; export default async function middleware(req, ev) { // the group is decided here, before the page renders return (await croMiddleware(req, ev, { publicKey: process.env.CRO_PUBLIC_KEY, })) ?? NextResponse.next();}
What gets in the way
A tag that loads after the page and swaps content in front of the shopper.
No way to create or read tests from code.
Nothing for a headless storefront or a page Shopify does not serve.
How Growth Dept CRO helps
On a theme the set-up is inlined, under 6 KB gzipped; on headless the middleware decides on the server.
CSS and JavaScript on any group, up to 8 KB each; flags read with window.CRO.flag().
Create drafts, start and end tests, read results; signed webhooks for each step.
What you get
Flags
One call on the theme, a header on headless.
Events
window.CRO.track() sends a custom event a test can count.
API
Keys carry only the scopes you choose.
Webhooks
HMAC-SHA256 over the timestamp and body.
Book a 45-minute call with the Growth Dept team. We look at your store and your traffic, and tell you which tests to run first.