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.

    Distribution

    View source

    Most of a discovery integration is storefront work: a search box, a results page with facets, recommendation strips, and the analytics wiring behind them. Distribution covers that side. Luigi’s Box hosts a git repository for your integration, pre-seeded with a working scaffold and a pack of skills written for coding agents. You clone it, tell your agent to integrate your site, review the result on a preview URL, and merge. The script your storefront loads is built and published from that repository.

    This is the default path. Start here unless one of the cases below applies.

    A repositoryHosted by Luigi’s Box, cloned and pushed with git and your Luigi’s Box credentials
    A scaffoldBuild tooling, the discovery library as a pinned submodule, and a place for your integration code
    A skill packProcedures your coding agent reads and follows — /integrate runs the whole job
    Branch previewsEvery pushed branch is loadable on your real site behind a query parameter
    A release pathA push to main builds, tests and republishes the script your site loads
    A place to rememberA memory/ directory the agent keeps: measurements, catalog facts, decisions and why

    An integration changes when your storefront’s markup changes, when you add a market, when a new surface goes live. A repository gives it:

    • Reviewable changes — a diff, on a branch, with a preview URL.
    • Controlled releasesmain is the release branch, and merging to it is your decision.
    • Persistent context — the agent’s notes, decisions and reasons are in the repository, so the next session, yours or an agent’s, starts from them.

    Distribution owns the storefront half of the integration. Everything else in these docs still applies, and the repository is a consumer of it:

    How a distributed integration fits togetherYour integration repository builds a loader script, the loader loads on your storefront, and the storefront sends discovery requests and analytics events to Luigi’s Box AI.Your integrationrepositoryLoader scriptYour storefrontLuigi’s Box AIbuildsloads ondiscovery requestsanalytics events

    You still get your catalog in, you still need a channel and a publishable key, and the events the integration sends are the events documented under Analytics. The browser code is what the repository provides.

    Distribution is the default, not the only way. Call the API directly when:

    • Your storefront renders results server-side. A backend that queries discovery and renders HTML has no place for a browser script — see Backend quickstart.
    • You have a frontend framework and a component library you intend to use. If discovery results are rendered by your own components, call the API directly — see Browser quickstart.
    • You are integrating something that is not a website. A mobile app, a kiosk, an internal tool.

    These are not exclusive. A common shape is a distribution repository for the storefront and a backend integration for indexing and configuration.

    Your first integrationCreate a repository and put an agent to work in it
    Previews and releasesBranches, preview URLs, and what a push to main does
    Repositories APICreating, listing and deleting repositories