Skip to content

    Pre-launch API. The concepts described here are settled, but the API shape is not: request and response fields, parameters and defaults can still change. Build against it, and talk to your Luigi's Box contact before you put an integration into production.

    Previews and releases

    View source

    Every push is built. Where that build ends up depends on which branch you pushed.

    Push toWhat happens
    Any branchBuilt, and loadable on your site at ?_lbx_env=<branch>
    mainBuilt, tested, and — if the tests pass — published as what your site loads

    Append the branch name to any page on your site:

    https://example.com/search?q=running+shoes&_lbx_env=search-widget

    The choice persists for the rest of that tab’s session, so you can navigate the site normally after setting it once. A new tab loads production again.

    Two reserved values:

    ValueEffect
    developmentLoad from your local yarn dev server
    stopTurn the integration off entirely for this session

    Use stop to establish whether a problem is yours or the integration’s: it removes the integration from the page without touching a deployment.

    If a branch’s build cannot be loaded, the loader falls back to production and says so in the browser console rather than leaving the page with no integration at all.

    Previews run on the real site, with real markup and real catalog data; there is no staging copy of your storefront to keep in sync.

    main is production. A push to it — normally a merge — is built, checked by an automated testing agent that exercises the integration against your live pages, and published if that passes. Nobody approves it in between; merging is the release decision.

    The published script is served from the repository’s loader_script_url, which never changes. Your site embeds it once and every subsequent release replaces what it serves.

    <script src="https://cdn.eu1.luigisbox.ai/b/lbdr_8w3k2p/loader.js"
    data-publishable-key="pub_live_eu1_CNA1QBVS7PQzKNDn"></script>

    Two parts to that tag:

    srcThe repository’s loader_script_url. Read it from the repository record rather than assembling it — see Repositories API.
    data-publishable-keyThe publishable key the integration authenticates with. Not a secret, and meant to be in page source.

    Work on a branch, not on main. A testing branch exists from the start for work in progress that is not ready for its own branch.

    The sequence:

    1. Branch from main.
    2. Push, and look at the preview URL on the pages that matter — including the ones you did not touch.
    3. Have whoever owns the storefront look at the same URL.
    4. Merge.

    A release is a commit on main, so a rollback is a git operation: revert the merge and push. That builds and republishes the previous state.

    Revert rather than force-push, so the history records what was live and when.