~/playground

Run Petri's checks on your own code.

This is the extension's rule engine, compiled for the browser: 17 of the 20 diagnostics and the same decision rule. (The other three need your petri.lock.json, your package.json, or a non-JavaScript SDK.) It checks your code against a copy of the real Petri Coffee project on self-hosted Flagsmith. Flip the switches to break the Flagsmith side. Nothing you paste leaves the page.

Your code
What Petri finds
    The Flagsmith project it checks against
    Results and the decision rule
    Flagsmith's dashboard says
    Petri's rule says

      Try "Traffic split went wrong": Flagsmith still says confirmed, and Petri refuses to ship.

      01 · What to try

      Things worth breaking.

      Self-hosted shop

      The silent one

      Flags work, events go to Flagsmith Cloud. PETRI012 on the line that creates the client. Add eventProcessorConfig: { eventsApiUrl } and it clears.

      Browser checkout

      Four bugs in ten lines

      Events disabled, a read that skips the exposure, a case-mismatched event and a flag name with a typo.

      Server, no identity

      Nobody enrolled

      getExperimentFlag() without an identifier on the server SDK, and a guardrail metric nothing tracks.

      Identity and caching

      Wired up, still wrong

      A variant in a publicly cached page (PETRI017), a fresh randomUUID() per visit (PETRI015), and conversions tracked by email while enrolment uses the user id (PETRI014).

      Traffic split went wrong

      Flagsmith vs Petri

      Flagsmith's banner still says "confirmed". Petri's own chi-square finds the broken split and refuses to ship.

      Experiment finished

      Dead code

      Every read of the flag becomes PETRI010: in the editor, the copilot removes the losing branch in one diff.

      Your code

      Paste anything

      JavaScript or TypeScript with the Flagsmith SDK. The flag here is checkout_cta; metrics count checkout_completed and order_value.

      The results are Flagsmith's own numbers for Petri Coffee on 28 Nov 2026 (2,028 shoppers). What each code means → · How the verdict is decided →

      Get this in your editor, as you type.