# AI Assistant (Alpha) (/assistant) # Alokai Enterprise (/enterprise) **Alokai Enterprise is a commercial offering from the Alokai team that gives you all the tools you need to launch your shop and provides you with ready-to-use integrations that will reduce your project's development time and cost.** The Enterprise license offers everything available in our open-source projects, plus: * [**Alokai Cloud**](/cloud) infrastructure optimized for performance and safety, which includes CDN, DDoS protection, and high SLA * [**Alokai Console**](/console) to manage your Alokai Cloud projects * Additional [**Integrations**](/integrations) with Enterprise-grade eCommerce platforms and third-party services * **Technical Support and SLA** to ensure you're set for success * and more... ## How to use Enterprise Packages [#how-to-use-enterprise-packages] Once you have access to our enterprise license, you can connect to our private repository that hosts the `@vsf-enterprise` packages. To use them, create the `.npmrc` file with the following content at the root of your project: ```bash @vsf-enterprise:registry=https://npm.alokai.cloud @alokai:registry=https://npm.alokai.cloud auto-install-peers=true ``` Then run the following command and enter your Alokai Enterprise account credentials: ```bash npm login --registry https://npm.alokai.cloud ``` # Alokai Docs (/) Alokai is a Frontend-as-a-Service that provides several tools to help you build performant, scalable, and customizable eCommerce storefronts. From UI libraries and integrations, to deployment and monitoring, we can help you build the ideal headless commerce experience. Learn more Learn more ## Products and Features [#products-and-features] # AI-assisted migration (/ai-coding-support/ai-migration) Every release publishes its migration steps for every Alokai project at once - the [upgrade guide](/alokai-versions) under the versions table is where you read them. Most of them don't apply to yours: a SAP Commerce Cloud step in a Commercetools-only project, a Nuxt step in a Next.js storefront, a package that moved for an integration you never installed. Working out which ones do apply means reading every step against your own repository - and applying one that doesn't apply is worse than skipping one that does, because it edits code for something you don't use and you have no reason to look there again. The `alokai-migration` skill does that gating for you, and works out where your project stands in the first place. It doesn't read the guide as prose: the same steps are published as data at `/alokai-versions/steps.json`, each one carrying the scope it applies to, the condition it turns on, and who is able to settle that condition. It ships in `@alokai/ai-toolkit`, so any coding agent that reads skills can run it - the examples on this page use Claude Code. ## Using it [#using-it] Run it with no arguments to move to the latest release: ```txt /alokai-migration ``` or just ask - "upgrade this project to the latest Alokai version", "bring this project up to date". To stop at a particular release, name it: ```txt /alokai-migration --to 2.4.0 ``` A version in the prompt - "upgrade to 2.4.0" - means the same as `--to`. Without either, the target is the newest release in the [compatibility matrix](/alokai-versions). One run covers the whole range. The skill works out the release your project is on, collects every step between that release and the target, and applies them in one pass - the steps of the releases in between included, so nothing is jumped. It does not hop release by release. A project rarely sits cleanly on one release: the CLI is on the latest, the middleware two minors back, and hopping to each intermediate release in turn would mean moving the packages that are already ahead *backwards* onto that release's pins. A single range run keeps every package that is already ahead where it is and never moves anything back. Once it has placed the project - and before its first edit - it tells you the plan: where every package stands, the start that follows from it, the target and the range, the human guide for the same range, which areas it is handing back, which packages it will not touch, and how many steps it is about to gate. That's a plan, not a request for permission - it carries on unless you stop it. The other argument is `--base `, which points the fetch at a preview deployment or a local docs server instead of `https://docs.alokai.com`. It names the base it used in both the plan and the report, and with a non-default base it treats every applied edit as a draft to show you rather than something to leave unreviewed - the default host is the one Alokai publishes, while a preview is built per pull request and a local server is whatever is on that machine. ## How it works out where your project is [#how-it-works-out-where-your-project-is] Your project's version is not one number, and the skill does not treat it as one. It reads the installed version of every package Alokai's taxonomy knows about - out of `node_modules`, never out of your manifests, because a manifest is what a half-finished upgrade edits - and places each one against every version the compatibility matrix ever pinned for it. A package is on a release (or on a run of releases that pinned the same version), between two pins, ahead of every pin the matrix knows, or behind the oldest one. The **start** is the release most of your packages agree on, lowered to the newest position any package below it can hold. A package pinned identically across ten releases agrees with everything and decides nothing; a SAP Commerce package two minors behind the CLI sets the start on its own. Packages whose positions all lie above that start are ahead of it - they stay where they are, and the steps that would have moved them are settled as already done rather than applied. Consecutive releases often pin the same versions, so a placement like `on 2.2.1..2.2.4` is a tie: `node_modules` cannot tell those releases apart. The skill takes the **oldest** member. That's the only direction whose failure mode is harmless - the steps of the later members whose packages already sit at the shared pin come back as already done, rather than a release's steps being skipped in silence. Nothing else places the project. Your root `package.json` `version` field is often a sprint tag; `yarn alokai version report` falls back to that label when nothing matches; a version you remember is the least reliable of the three. Where any of them disagrees with the placement, the report says so beside it - and none of them is used. The skill never runs `version check` itself, because that command writes the resolved version into your manifests. Where a package sits below the oldest version the matrix records for it, the steps that would bring it up predate the published steps, so the skill can't read them. It hands that package's whole area back - the package, its version, the oldest version the matrix knows, and the guide URL to read - and migrates the rest of the project. Nothing in that area is guessed. The **target** is `--to` or the latest release. A target at or below the start is nothing to migrate, and the skill says so rather than moving anything backwards to reach it. ## How it decides what applies [#how-it-decides-what-applies] ### It profiles your repository before it reads the steps [#it-profiles-your-repository-before-it-reads-the-steps] Before it fetches the steps at all, the run builds a fact sheet of the project. Framework per store, every integration and module, the store list from `alokai.config.json`, the root scripts and what each covers, every patched package, every test suite and whether it needs a running server - each one backed by a path or a dependency it actually saw. The order is the point. Profiling after reading the steps turns into hunting for confirmation of whatever the release happened to mention; profiling first produces a profile that doesn't know what the steps are looking for. Each step's scope is an area id from Alokai's own taxonomy, and the skill carries a table mapping every area onto the file or dependency that proves it. That table is generated from the same taxonomy the steps are authored against, so the two can't disagree about what `sapcc` or `nextjs` means. Where a release is newer than the toolkit your project has installed, its steps can name a scope the local taxonomy has never heard of - the skill names that one in the report and gates it by hand rather than guessing. ### What a step carries, and which fields gate it [#what-a-step-carries-and-which-fields-gate-it] The steps arrive as data - one JSON document carrying every release, each step a record: ```json { "id": "instrumentation-register", "version": "2.3.6", "title": "Call Alokai's `register` from your own instrumentation hook", "appliesTo": "nextjs", "onlyIf": "your `instrumentation.ts` exports a `register` that does not reference `@vue-storefront/next/instrumentation`", "onlyIfKind": "repo", "phase": "after-upgrade", "order": 2, "packages": ["@vue-storefront/next", "@alokai/cli"], "area": "storefront", "body": "..." } ``` `version` is what the run selects on - every step whose release lies inside the range - and `body` holds the instructions themselves. The run applies nothing and says so, rather than reconstructing steps from a changelog or from memory. The placement is planned from the matrix and the steps together, so without the steps there is no plan either: you get the profile it built, the URL and status that failed, and the [upgrade guide](/alokai-versions), where the same range is assembled for reading - so the migration is still yours to do by hand. Two verdicts are settled by the placement before any condition is read: a step whose named packages already sit at or past its release's pin is **already done**, and a step in an area below the map is **handed back** with that area - both listed in the report with their titles, so you can see what was assumed, and never applied. Every other step applies only when **`appliesTo` matches the profile and `onlyIf` holds**. `appliesTo` is checked first, so an `onlyIf` about SAP Commerce internals is never even evaluated in a Commercetools-only project. `appliesTo: all` is every project, and `onlyIf: always` is unconditional inside the scope. `appliesTo` is the gate nothing survives. Where the signal for an area is absent the verdict is **skipped**, and the report names the signal that was looked for - even where the step's mechanics would plainly have worked here. Scope is a fact about your project, not a preference. Of the remaining fields, `packages` is the one the **already done** verdict above is read from - it names what delivers the change, and where every package it names already sits at or past the step's release there is nothing left to apply. The rest describe the change rather than gate it: `phase` puts a step before or after the package move, `order` places it within its release, `area` says where the change belongs - which isn't always the same as its scope - and `supersedes` names a step of an earlier release that this one replaces. Inside the range the skill folds those chains the same way the upgrade guide does: a later step replacing an earlier one removes the earlier one from the plan, and a step retiring one from before your start is reported as completing that chain. ### Who settles a condition is published with the step [#who-settles-a-condition-is-published-with-the-step] `onlyIfKind` says which of three kinds the condition is. It's authored with the release rather than guessed by your agent, and it decides who answers: | `onlyIfKind` | Example | What happens | | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`repo`** - names a file, an import, a config key, an API, or something the repository records | *your `instrumentation.ts` exports a custom `register`* | The skill greps for it and then opens every hit before ruling - a match is a place to look, not a verdict. "Probably not present" isn't an answer; it runs the check. | | **`outside`** - CI settings, deployment variables, backend or infrastructure configuration | *you deploy against a non-default Console API URL* | Handed back to you as an action item stating the exact change and where to make it. Nothing in the working tree can settle it, so it is never guessed - and never quietly dropped because it isn't code. | | **`judgement`** - intent, preference, or a fact about the team | *you want coding agents to follow Alokai conventions* | Put to you. Any repo-checkable half of the condition is settled first, so you answer one question instead of the whole step. | Where your repository *records* the answer to an `outside` or `judgement` condition, the skill settles it rather than handing you a decision you don't have - `git remote -v` answers "you host code on GitLab", a missing `patches/` directory answers a condition about patches - and says both the kind the release assigned and what settled it. That stops at what the repository records: a deploy workflow existing doesn't prove anyone runs it. A condition often has several clauses that don't share a kind. Each is settled independently, and the joiner decides what an unsettled one costs: with **and**, one false clause ends the step; with **or**, a false clause rules out nothing and the rest govern. A step ruled out by a clause the skill *can* settle is simply skipped, whatever the rest would have needed. A step still in scope with one clause it can't settle is handed back with the others already answered, so you're left with one question rather than the whole step. A step with several numbered parts is gated per part - a Nuxt-only part in a project with no Nuxt app is skipped on its own, and the report records the verdict part by part. The skill prints the whole gated table before its first edit: every step in the range, its verdict, and for the ones that apply what is about to change. If you disagree with an *applies*, that's the moment to stop it. ### Applied steps reach your per-store overrides [#applied-steps-reach-your-per-store-overrides] If a step edits `apps/storefront-unified-nextjs/instrumentation.ts`, every store that overrides that same relative path under `apps/stores//storefront-unified-nextjs/` gets the same change. The override wins at build time, so a base-only edit silently does nothing for that store - which is the kind of miss that surfaces weeks later as one store behaving differently from the rest. The same logic runs in reverse for scope: a step whose scope matches only some of your stores is applied only in those stores. ## The package move isn't a step, and it's the biggest piece [#the-package-move-isnt-a-step-and-its-the-biggest-piece] Every release moves packages, and that move is published as the compatibility matrix rather than as a step. The skill applies it once, between the range's `before-upgrade` and `after-upgrade` steps, because the later steps target APIs that only exist once it lands. It is where a migration most often stops half-done. `yarn alokai version upgrade` moves the **core packages only** - `@alokai/cli`, `@alokai/connect`, `@vue-storefront/next`, `@vue-storefront/nuxt` - and it moves them as one matrix row, so it aborts outright on a project whose packages sit on different releases. Most of the diff is not those four. Run the command, stop there, and the project still compiles and still boots - a half-upgraded project passes a build check. So the skill doesn't run it. It works the diff package by package, forward only, and what each package needs comes from its placement and from the delivery type the taxonomy records for it: * **A package below the target** is written at the target version, bare, into every manifest that declares it - the apps, shared `packages/*` configs, and per-store overrides - after confirming that version exists on the registry. * **A package already at or ahead of the target** is left untouched, and the report lists it as such. * **A package the matrix stopped pinning, or never pinned,** is moved or removed only where a step in the range asks for it. A package no step names is not touched. * **`cli-plugin`** delivery is handed back, never run for you. A `@alokai/cli-plugin-*` package lives in the CLI's machine-wide plugin store rather than in any manifest, so installing it affects every project on your machine and would replace a plugin you have linked to a local checkout. You get the installed version, the target, and the command. * **`add-module`** delivery is `yarn alokai add-module `, and only where your project already has the module or a step asks for it. * **A package that's there transitively** can sit in `node_modules` while appearing in no manifest. No manifest line is written for it up front; after the install the skill confirms its parent carried it to the target, and only a package left lagging gets a `resolutions` entry. Then one install. It fires your project's install hooks, and the skill reads them before running it: a `patch-package` postinstall reapplies every recorded patch, and a patch that no longer applies to the moved package is handed back with the failing hunk; a `preinstall` that cleans `.out` means the composed workspace is gone until the next `store build`; a generated project's `postinstall` runs `yarn alokai version check` and `yarn alokai ai sync`, so the version label and the synced skills change under the CLI's hand rather than the agent's, and the report attributes those edits to the CLI. Afterwards every moved package is confirmed at its target in `node_modules`, and every removal is confirmed absent from the manifests and the lockfile. A step of the release overrides all of this for the package it names, and the report says where that happened - a step is written against its release, while the list above is written against projects in general. That override stays inside what a step is allowed to ask for at all: an edit inside your working tree, a dependency bump, or a command your project already exposes. A step body asking for anything else - a download piped into a shell, a write outside the tree, a credential, a git remote, a disabled check - is treated as a defect in the published data and reported rather than run, and so is text in a step that addresses the agent instead of describing the release. The skill never edits the `version` field in your root `package.json` itself, except where a step names it. In a generated project the install hook does: `postinstall` runs `yarn alokai version check`, which writes the CLI's own resolution of the project into the root, middleware, storefront and Playwright manifests. That resolution leans towards the newest release pinning the same core packages, so the label can land one patch above the target you named. In a project without that hook the label still reads what it read before the run. Either way the CLI injects it into every composed `.env` as `NEXT_PUBLIC_ALOKAI_VERSION` and the storefront publishes it, so the report states where the label and the dependencies now disagree in a form you can act on - "the label reads 1.0.0, the project carries 2.4.1's dependencies". ## Validation [#validation] A migration isn't reported as done until every check that can run passes. Before its first edit the skill records a **baseline**: it runs lint, typecheck and every test suite that needs no running server, and writes down what already fails. After the migration, a failure that is also in the baseline is pre-existing - reported under its own heading and left alone. The correction loop targets only what the migration broke. Then, in this order, each compared against that baseline: * **Lint** and **typecheck** - your project's root `lint` and `typecheck` scripts. Both run before the build because in a generated project they recompose the workspace and leave the storefront looking unbuilt. `next build` proves nothing about types in a generated app - `ignoreBuildErrors` is on - so typecheck runs whatever the build says, and a turbo replay that checked nothing is rerun with the cache forced. * **Tests that need no server** - the unit and integration suites the profile found, each by its own command. * **Build** - `yarn alokai store build --store-id=` for each store whose scope matched an applied step, one deployable store when every applied step was scoped `all`. Success is read off the artifacts, not the command's log: a cached build unpacks an archive and reports success having compiled nothing, so the skill checks that the outputs carry a real compile's spread of timestamps and forces one if they don't. * **Start** - a `store dev` smoke run, polled until the storefront answers, then cross-checked by the listener's working directory - a status code proves something is on the port, and only the process's own directory proves it's your store. While the server is up, every applied step that changes runtime behaviour gets one `curl` that proves it: a header, a redirect, an endpoint. * **Tests that need a server** - end-to-end suites, against the server the skill started or after it shuts that one down, depending on whether the suite starts its own. * **Shutdown** - whatever the run started is stopped, and the report states in one line that the ports are free again. Projects the CLI did not generate run through their own root scripts - `lint`, `typecheck`, `build`, `dev` or `start` - and the test suites the profile discovered, because customers share no layout. A project with no test suites at all is validated by lint, typecheck, build and start, and the validation section of the report says so, because a reader otherwise assumes tests ran. ### When a check fails [#when-a-check-fails] A failure that isn't in the baseline is work left, not a result to write down. The skill classifies it and corrects the migration: a failure in a file a step edited means the step was misapplied, so it rereads the step against the file and redoes the edit; a failure naming a symbol a moved package changed, in a file no step names, is the release's own fallout, which the skill fixes and lists as a gap in the published steps; a failure matching a step it had skipped or settled as already done means a gate was wrong, so it re-gates that step on the evidence and says the verdict changed; a failure naming a config, an environment variable or a backend is outside the tree and is handed back with the exact change. Then it reruns the check. The fix comes from the published steps, from the release's fallout in your tree, or from you - never invented. Disabling a check, loosening a type, adding a lint suppression or building with the compose-only flag is not a fix. A correction that leaves the same failure standing is not repeated on the skill's own. It puts the failure to you in the session - the error text, what it tried, what it would try next - and you choose: try again, stop, or say what to do. An instruction you give that no step carries is applied and reported as a documentation gap marked as user-directed. On stop, the failure is handed back with every attempt and the error text. With nobody in the session to ask, the skill hands back after that first attempt. A rerun that fails on a *different* error is progress, and that failure gets its own correction round. A check has four outcomes, not two. **Passed** and **failed** are what they sound like. **Blocked** means the check never ran for a reason outside your project - a port already held by your docs server or another store, a suite that needs a credential the machine doesn't have, an unreachable host. Nothing of yours was started, nothing was killed to clear the way, and the report names the one thing that unblocks it. A migration with a blocked check is partially validated and the report says so. The fourth is a pass that could not see the change: a build and a boot are blind to a type made required in a type your project never names, or a hook that fires only on install. For those the report says what the checks covered and what static artifact - a `.d.ts`, a manifest's `exports`, the composed `.env` - it read instead. ## What you get back [#what-you-get-back] The report opens with where the run got to: the placement per package, the start and what fixed it, the target, the areas handed back whole, and whether validation is green, partially blocked, or stopped. Then one table, one row per step in the range in plan order - including the steps that didn't apply, each with the field that ruled it out: | Step | Release | Applies to / Only if | Verdict | What happened | | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------- | | `instrumentation-register` | 2.3.6 | `nextjs` / your `instrumentation.ts` exports a `register` that does not reference `@vue-storefront/next/instrumentation` | applies | `apps/storefront-unified-nextjs/instrumentation.ts` edited, and the same path in two store overrides | Every step gets exactly one of seven verdicts: **applies**; **skipped**, with the gate and the signal that ruled it out; **already done**, where the packages the step names were at or past its release before the run; **handed back**, for an `outside` condition nothing in your repository can settle or for an area below the map; **needs an answer**, for a `judgement` condition with nobody in the session to ask; **satisfied, no action**, where both gates hold and nothing in your project changes; and **applied, mechanism inert**, where the step was applied as written and doesn't achieve what it says - reported with the evidence that it's inert, and with the smallest change that does achieve it. Then eight sections, in this order: 1. **Needs an answer** - each judgement call with the default and the one thing the answer turns on. 2. **Handed back** - areas below the map with their packages and the guide URL, `outside` conditions with the exact change and where, plugin moves, patches that failed to apply, steps that couldn't be applied from what's in the tree. 3. **Already done** - the steps the placement settled, with their titles. 4. **Packages** - one line per package: what happened to it and where it landed. 5. **Documentation gaps** - every fix validation needed that no step named, with the file and the error; the ones you directed are marked so. 6. **Pre-existing failures** - items from the baseline still failing. 7. **Validation** - each check with its outcome, what the passes verified and what they couldn't observe, and the shutdown line. 8. **Changes** - the files that changed and the files the run created, so you can review and stage them; the skill stages nothing itself. Every section is printed even when it's empty, saying `None`. That's the same reason the table lists steps that didn't apply: silence can't be told apart from an omission. ## Getting the skill [#getting-the-skill] The skill reaches your agent through `alokai ai sync`, like the rest of the toolkit ([Syncing skills](/ai-coding-support/syncing-skills)): ```bash ls .claude/skills/ai-toolkit-alokai-migration # Claude Code ls .agents/skills/ai-toolkit-alokai-migration # Codex, Gemini CLI, GitHub Copilot ``` A project still on an older `@alokai/ai-toolkit` doesn't have it yet - bump the package and re-sync. The steps themselves always come from the docs site, so the skill can migrate a project to any published version regardless of which toolkit version shipped it. ## Related [#related] # AI code review (/ai-coding-support/ai-review) Alokai ships an AI code reviewer that posts findings as inline review comments on your pull requests, and can apply the fix for a finding on request. It knows your project's conventions, because it reviews against the same skills and version-matched docs your coding agents use - see [AI Coding Support](/ai-coding-support). The reviewer is the `@alokai/cli-plugin-review` plugin for the Alokai CLI. You run it from your own CI: GitHub Actions and GitLab CI are both supported, and the setup is the same shape on each - give the bot an identity you own, add a job, set a handful of variables. The criteria the bot reviews against also ship as skills your coding agent can run, so you can review your own branch before the bot ever sees it, and fix the bot's findings without leaving the agent - see [Using it](#using-it). ## Where your code goes [#where-your-code-goes] The review runs entirely in your CI, under an identity you own. Alokai hosts no shared bot and no Alokai service reads your repository. The one thing that leaves it is what the reviewer sends to the model: the diff under review and the file context around it, sent to the LLM endpoint Alokai provisions for your project. ## Using it [#using-it] Setup ([below](#set-it-up)) is a one-time job, usually done by one person on the team. This section is for everyone else - the day-to-day of working with the reviewer. ### Review before the bot does [#review-before-the-bot-does] The criteria the bot enforces aren't locked inside CI. They also ship as two skills in `@alokai/ai-toolkit` - `alokai-review` (review a change and report findings) and `autofix` (apply accepted findings) - and `alokai ai sync` links them into your coding agents' skill directories alongside the rest ([Syncing skills](/ai-coding-support/syncing-skills)). Any coding agent that reads skills can run them; the examples on this page use Claude Code. When you finish a piece of work, run the review on your own branch before opening the pull request: ```txt /alokai-review ``` or just ask - "review my branch". The agent reviews the same way the CI bot does - same skills, same conventions, same version-matched docs - but reports in the conversation and posts nothing anywhere. What you fix here never shows up as a bot comment, and the CI review on the eventual pull request stays short. The bot's review also runs from your machine against an open pull or merge request, with the same LLM configuration in your environment: ```sh # Review a merge request (iid and project path, host from the git remote): yarn alokai ai review --pr 42 --repo my-group/my-project # Self-managed instance - pass the host explicitly: yarn alokai ai review --pr 42 --repo my-group/my-project --host gitlab.acme.com ``` ### Automatic review [#automatic-review] Every non-draft pull or merge request gets reviewed when it's opened and on every push, on gates built into the CI job you'll add in [Set it up](#set-it-up): bot branches and PRs labelled `skip-ai-review` are skipped, and a new push cancels the review still running for the previous one. ### Skip a single pull request [#skip-a-single-pull-request] Add the `skip-ai-review` label to it. On an open PR the label takes effect from the next push. ### Incremental re-reviews [#incremental-re-reviews] Reviews are incremental by default: when the bot has already reviewed a pull request, the next run covers only what changed since that review, instead of the whole diff. Pushing a fix doesn't bring back findings on code nobody touched, and re-runs stay short. `AI_REVIEW_INCREMENTAL` and the `--incremental` flag pin that behavior explicitly. You don't need to set the variable to get it. ### Fix a finding [#fix-a-finding] The reviewer can apply its own findings, committing the change and replying in the thread of the comment it fixed. There are three ways to trigger a fix, in order of convenience. **1. Reply `/fix` in the pull request.** Nothing to run, no checkout needed - the fix runs in CI and pushes to the branch. With the [`/fix` command workflow](#fixing-findings-from-a-pull-request-comment) in place, the author of a pull request fixes findings from the PR itself: * **Reply `/fix` to an inline finding** - fixes that one finding. * **Comment `/fix` on the pull request** - fixes every open finding on it. * **Add context after the command** - `/fix use the existing helper instead of a new one` - and the bot takes it into account. The fix is committed and pushed to the PR head branch by **Alokai AI Review**, which then replies with what it changed. Only the pull request's author can run the command. With the [comment-triggered fix](#fixing-findings-from-a-merge-request-comment) in place, the MR author replies `/fix` to a finding and the pipeline applies it - the same chatops GitHub gets from the command workflow. **2. Ask your coding agent.** In Claude Code: ```txt /autofix https://github.com/acme/store/pull/42 ``` or just "fix the review comments on my PR". The agent reads the review threads, applies the smallest edit per finding, skips stale ones with a stated reason, and asks you before pushing or replying to anything. Unlike the `/fix` comment, this path has a human in the loop: a finding that needs a judgement call gets asked, not guessed. It runs on the agent's own model, so `AI_REVIEW_API_KEY` isn't needed here. **3. Run the CLI locally.** `yarn alokai ai fix` from your checkout does exactly what CI does, but needs the LLM configuration in your local environment - reach for it when neither of the above is available: ```sh # Fix every open finding - paste the pull or merge request URL: yarn alokai ai fix https://gitlab.com/my-group/my-project/-/merge_requests/42 # Fix one finding - copy the URL of its comment: yarn alokai ai fix https://gitlab.com/my-group/my-project/-/merge_requests/42#note_123 ``` Add `--instruction "..."` to give the fix extra context. ### Turn it off [#turn-it-off] * **Disable it**: leave `AI_REVIEW_ENABLED` unset, or set it to any value other than `true`. The job no-ops. * **Remove it entirely**: delete `.github/workflows/ai-review.yml`, or the `ai-review` job from `.gitlab-ci.yml`. ## Set it up [#set-it-up] ### What you need [#what-you-need] 1. **A bot identity you own.** Comments are posted by an account you control, so the reviewer never speaks as a shared third party. On GitHub that's a GitHub App registered under your organization; on GitLab it's a project access token, which acts as its own bot user. Name it **Alokai AI Review** either way - the name is what shows on every comment it posts. 2. **An LLM API key.** Provisioned by Alokai - contact your Alokai representative to get the key for your project, and do **not** commit it into the repository. The endpoint and model come with sensible defaults, so most projects need nothing else; override them only if your representative gives you project-specific values. ### Install the plugin [#install-the-plugin] Add the plugin as a dev dependency, so CI picks it up with the rest of your install: ```sh yarn add -D @alokai/cli-plugin-review ``` The criteria the reviewer applies come from `@alokai/ai-toolkit`, synced into the checkout by `alokai ai sync`. Generated Alokai storefronts have the toolkit in `devDependencies` and run sync on `postinstall`, so a normal `yarn install` in CI is enough. If your CI installs with lifecycle scripts disabled, add `yarn alokai ai sync` as an explicit step - see [Syncing skills](/ai-coding-support/syncing-skills). ### Configuration [#configuration] Every provider reads the same variables. The API key is the only one you have to set - the rest have defaults that suit most projects. Set them in your CI platform, not in the repository, and mark the API key as a secret (masked) variable. | Name | Secret | Value | | ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------- | | `AI_REVIEW_ENABLED` | | `true` to turn the review on. Anything else (including unset) makes the job no-op. | | `AI_REVIEW_API_KEY` | ✓ | The LLM API key provided by Alokai. | | `AI_REVIEW_BASE_URL` | | *(optional)* An OpenAI-compatible LLM endpoint, when Alokai provisioned a project-specific one. Unset uses the default. | | `AI_REVIEW_MODEL` | | *(optional)* A model name, when Alokai gave you one. Unset uses the default. | | `AI_REVIEW_INCREMENTAL` | | *(optional)* Incremental review is already the default - see [Incremental re-reviews](#incremental-re-reviews). | | `AI_REVIEW_PROVIDER` | | *(optional)* `github` or `gitlab`, when the host can't be recognized - see [Provider detection](#provider-detection). | Each platform adds the variables for its own bot identity on top of these; they're listed in the setup steps below. On GitHub the reviewer runs as a turnkey Actions workflow. ### Register a GitHub App [#register-a-github-app] Register a GitHub App **under your own organization** - you own it, and it is not shared with Alokai or other customers. The app's name is the bot's identity on every review comment, so brand it **Alokai AI Review**. [Register the app by hand](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) with these repository permissions: * **Contents**: Read-only - read the code to review. * **Issues**: Read & write - post and update review comments. * **Pull requests**: Read & write - post inline review comments and replies. Generate a private key for the app and note its **App ID** - you'll need both in step 3. Finally, install the app on the repositories that should get AI review (**Settings → GitHub Apps → Install**). A [manifest](https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest) pre-fills the name and permissions and returns the App ID and private key in one exchange, which is worth the extra machinery if you're scripting this. See [Registering from a manifest](#registering-from-a-manifest). ### Add the workflow [#add-the-workflow] Create `.github/workflows/ai-review.yml` with the following content: ```yaml [.github/workflows/ai-review.yml] name: "AI Review" # Alokai AI code review. Disabled by default: set the repo variable # AI_REVIEW_ENABLED to 'true' after completing the setup. on: pull_request: types: [opened, synchronize, reopened, ready_for_review] concurrency: group: "ai-review-${{ github.event.pull_request.number }}" cancel-in-progress: true # Branches that should not be reviewed (automated/bot PRs). # SKIP_BRANCHES: comma-separated head-branch prefixes, e.g. "dependabot/,renovate/". env: SKIP_BRANCHES: "dependabot/" defaults: run: shell: "bash" jobs: review: name: "AI Review" runs-on: "ubuntu-latest" if: >- ${{ vars.AI_REVIEW_ENABLED == 'true' && github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'skip-ai-review') }} timeout-minutes: 30 permissions: contents: "read" id-token: "write" issues: "write" pull-requests: "write" steps: - name: "Mint identity token" id: "mint_identity_token" if: |- ${{ vars.AI_REVIEW_APP_ID }} uses: "actions/create-github-app-token@v2" with: app-id: "${{ vars.AI_REVIEW_APP_ID }}" private-key: "${{ secrets.AI_REVIEW_APP_PRIVATE_KEY }}" permission-contents: "read" permission-issues: "write" permission-pull-requests: "write" - name: "Checkout repository" uses: "actions/checkout@v5" with: fetch-depth: 0 - name: "Check if review should run" id: "gate" env: HEAD_REF: "${{ github.head_ref }}" run: | HEAD="${HEAD_REF}" IFS=',' read -ra PATTERNS <<< "${SKIP_BRANCHES}" for pattern in "${PATTERNS[@]}"; do [[ -z "${pattern}" ]] && continue if [[ "${HEAD}" == ${pattern}* ]]; then echo "⏭ Skipping review: branch '${HEAD}' matches skip pattern '${pattern}'" echo "skip=true" >> "${GITHUB_OUTPUT}" exit 0 fi done echo "✓ Branch '${HEAD}' is eligible for review" echo "skip=false" >> "${GITHUB_OUTPUT}" - name: "Install dependencies" if: ${{ steps.gate.outputs.skip != 'true' }} uses: "./.github/actions/setup" with: npm_user: "${{ vars.NPM_USER }}" npm_password: "${{ secrets.NPM_PASS }}" npm_email: "${{ vars.NPM_EMAIL }}" npm_registry_url: "${{ vars.NPM_REGISTRY_URL }}" - name: "Install review plugin into Alokai CLI" if: ${{ steps.gate.outputs.skip != 'true' }} run: yarn alokai plugins link node_modules/@alokai/cli-plugin-review - name: "🔄 Sync @alokai/ai-toolkit skills" if: ${{ steps.gate.outputs.skip != 'true' }} run: yarn alokai ai sync --yes - name: "🚀 Run AI review" if: ${{ steps.gate.outputs.skip != 'true' }} env: GITHUB_TOKEN: "${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN || github.token }}" GITHUB_REPOSITORY: "${{ github.repository }}" PR_NUMBER: "${{ github.event.pull_request.number }}" AI_REVIEW_API_KEY: "${{ secrets.AI_REVIEW_API_KEY }}" AI_REVIEW_BASE_URL: "${{ vars.AI_REVIEW_BASE_URL }}" AI_REVIEW_MODEL: "${{ vars.AI_REVIEW_MODEL }}" # Incremental review is the default; this pins it explicitly. AI_REVIEW_INCREMENTAL: "${{ vars.AI_REVIEW_INCREMENTAL }}" run: | # Flags are added only when their variable is set, so unset vars fall # back to the plugin defaults instead of overriding them with "". ARGS=() if [[ -n "${AI_REVIEW_BASE_URL}" ]]; then ARGS+=(--base-url "${AI_REVIEW_BASE_URL}"); fi if [[ -n "${AI_REVIEW_MODEL}" ]]; then ARGS+=(--model "${AI_REVIEW_MODEL}"); fi if [[ "${AI_REVIEW_INCREMENTAL}" == "true" ]]; then ARGS+=(--incremental); fi yarn alokai ai review "${ARGS[@]}" ``` The "Install dependencies" step uses the `./.github/actions/setup` composite action that ships with generated Alokai storefronts (npm registry auth + `yarn install`). If your repository doesn't have it, replace that step with your own Node setup and `yarn install`. ### Add variables and secrets [#add-variables-and-secrets] In **Settings → Secrets and variables → Actions**, add everything from [Configuration](#configuration) - `AI_REVIEW_API_KEY` as a secret, the rest as variables - plus the two that identify your GitHub App: | Name | Kind | Value | | --------------------------- | -------- | ------------------------------------------------ | | `AI_REVIEW_APP_ID` | Variable | Your GitHub App's ID. | | `AI_REVIEW_APP_PRIVATE_KEY` | Secret | Your GitHub App's private key (`.pem` contents). | Leave `AI_REVIEW_ENABLED` unset for now. ### Enable it and check the first run [#enable-it-and-check-the-first-run] Set `AI_REVIEW_ENABLED` to `true`, then open a pull request (or push to an open one) and watch the **Actions** tab: * **No "AI Review" run at all** - `AI_REVIEW_ENABLED` isn't `true`, the PR is a draft, or it carries the `skip-ai-review` label. * **The run ends at "Check if review should run"** - the head branch matched a `SKIP_BRANCHES` prefix. The step log names the pattern it matched. * **The run completes** - findings appear as inline comments within a minute or two, posted by **Alokai AI Review**. If the run fails, see [Troubleshooting](/ai-coding-support/troubleshooting#the-ai-review-job-fails-or-posts-nothing). #### Fixing findings from a pull request comment [#fixing-findings-from-a-pull-request-comment] The reviewer can also apply its own findings. Add a second workflow, and the PR author fixes a finding by replying `/fix` to it - no local checkout, no CLI: ```yaml [.github/workflows/ai-review-command.yml] name: "AI Review Command" # Chatops for the AI review: the PR author comments `/fix [extra context]` to # have the bot apply fixes. A `/fix` reply on an inline finding fixes that one # finding; a top-level `/fix` comment fixes every open finding on the PR. The # fix is committed and pushed to the PR head branch. on: issue_comment: types: [created] pull_request_review_comment: types: [created] concurrency: group: "ai-review-command-${{ github.event.issue.number || github.event.pull_request.number }}" cancel-in-progress: false defaults: run: shell: "bash" jobs: fix: name: "AI Fix" runs-on: "ubuntu-latest" # Cheap pre-filter, tightened to an exact `/fix` token in the resolve step: # a PR comment, never the bot's own (so a fix reply can't re-trigger a fix), # and only from the PR author. The inactive side of `||` is null and never # matches. if: >- ${{ github.event.comment.user.type != 'Bot' && github.event.comment.user.login == (github.event.issue.user.login || github.event.pull_request.user.login) && ( (github.event_name == 'issue_comment' && github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/fix')) || (github.event_name == 'pull_request_review_comment' && startsWith(github.event.comment.body, '/fix')) ) }} timeout-minutes: 30 permissions: contents: "write" id-token: "write" issues: "write" pull-requests: "write" steps: - name: "Mint identity token" id: "mint_identity_token" if: |- ${{ vars.AI_REVIEW_APP_ID }} uses: "actions/create-github-app-token@v2" with: app-id: "${{ vars.AI_REVIEW_APP_ID }}" private-key: "${{ secrets.AI_REVIEW_APP_PRIVATE_KEY }}" permission-contents: "write" permission-issues: "write" permission-pull-requests: "write" - name: "Resolve trigger" id: "trigger" env: GH_TOKEN: "${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN || github.token }}" # Comment body via env, never interpolated into the script, to avoid command injection. COMMENT_BODY: "${{ github.event.comment.body }}" EVENT_NAME: "${{ github.event_name }}" ISSUE_PR_NUMBER: "${{ github.event.issue.number }}" REVIEW_HEAD_REF: "${{ github.event.pull_request.head.ref }}" run: | set -euo pipefail # `/fix` must be the exact first token, so `/fixup` does not trigger a fix. first_line="$(printf '%s' "${COMMENT_BODY}" | head -n1)" if [[ ! "${first_line}" =~ ^/fix([[:space:]]|$) ]]; then echo "Comment does not start with the /fix command token; skipping." echo "match=false" >> "${GITHUB_OUTPUT}" exit 0 fi echo "match=true" >> "${GITHUB_OUTPUT}" # An inline-comment event carries the PR head ref; a conversation # comment does not, so resolve it. if [[ "${EVENT_NAME}" == "pull_request_review_comment" ]]; then head_ref="${REVIEW_HEAD_REF}" else head_ref="$(gh pr view "${ISSUE_PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --json headRefName -q .headRefName)" fi echo "head_ref=${head_ref}" >> "${GITHUB_OUTPUT}" # Everything after the leading `/fix` is extra context for the fix. instruction="$(printf '%s' "${COMMENT_BODY}" | sed -E '1 s|^[[:space:]]*/fix[[:space:]]*||')" { echo "INSTRUCTION<<__FIX_EOF__" echo "${instruction}" echo "__FIX_EOF__" } >> "${GITHUB_ENV}" - name: "Checkout PR head branch" if: ${{ steps.trigger.outputs.match == 'true' }} uses: "actions/checkout@v5" with: ref: "${{ steps.trigger.outputs.head_ref }}" fetch-depth: 0 token: "${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN || github.token }}" - name: "Install dependencies" if: ${{ steps.trigger.outputs.match == 'true' }} uses: "./.github/actions/setup" with: npm_user: "${{ vars.NPM_USER }}" npm_password: "${{ secrets.NPM_PASS }}" npm_email: "${{ vars.NPM_EMAIL }}" npm_registry_url: "${{ vars.NPM_REGISTRY_URL }}" - name: "Install review plugin into Alokai CLI" if: ${{ steps.trigger.outputs.match == 'true' }} run: yarn alokai plugins link node_modules/@alokai/cli-plugin-review - name: "🔄 Sync @alokai/ai-toolkit skills" if: ${{ steps.trigger.outputs.match == 'true' }} run: yarn alokai ai sync --yes - name: "Configure git identity" if: ${{ steps.trigger.outputs.match == 'true' }} run: | git config user.name "Alokai AI Review" git config user.email "alokai-ai-review@users.noreply.github.com" - name: "🛠 Run AI fix" if: ${{ steps.trigger.outputs.match == 'true' }} env: GITHUB_TOKEN: "${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN || github.token }}" GITHUB_REPOSITORY: "${{ github.repository }}" AI_REVIEW_API_KEY: "${{ secrets.AI_REVIEW_API_KEY }}" AI_REVIEW_BASE_URL: "${{ vars.AI_REVIEW_BASE_URL }}" AI_REVIEW_MODEL: "${{ vars.AI_REVIEW_MODEL }}" run: | yarn alokai ai fix \ "${{ github.event.comment.html_url }}" \ --instruction "${INSTRUCTION}" ``` This workflow needs no variables beyond the ones you already set - but note it grants **Contents: write**, because it commits to the PR branch. Two guards keep that narrow: only the pull request's own author can trigger a fix, and the bot's own comments are ignored so a fix reply can't trigger another fix. Unlike the review workflow, this one has no `AI_REVIEW_ENABLED` gate: it only ever runs when someone types the command. #### Registering from a manifest [#registering-from-a-manifest] A manifest pre-fills the app's name and permissions and hands back its credentials, which saves time when you're setting up several organizations or scripting the process. This is the manifest the app needs: ```json [manifest.json] { "name": "Alokai AI Review", "url": "https://alokai.com", "public": false, "default_permissions": { "contents": "read", "issues": "write", "pull_requests": "write" }, "redirect_url": "https://alokai.com" } ``` GitHub only accepts a manifest as a form POST, so save it as the `manifest` field of a form, replace `YOUR_ORG`, open the file in a browser, and submit: ```html [register-app.html]
``` After you confirm the registration, GitHub redirects to the `redirect_url` with a temporary `code` query parameter. Exchange it within one hour for the app's credentials: ```sh gh api -X POST /app-manifests//conversions ``` The response contains the **`id`** (your App ID) and **`pem`** (the private key). Continue from step 3 above.
On GitLab there is no dedicated CI integration - the plugin doesn't read GitLab's CI environment on its own - so a merge request pipeline passes GitLab's [predefined variables](https://docs.gitlab.com/ci/variables/predefined_variables/) to the CLI as flags. The job below mirrors the GitHub workflow, including all of its gates. ### Create a project access token [#create-a-project-access-token] Create a **project access token** with the `api` scope in **Settings → Access tokens**. A project access token acts as a dedicated bot user, so comments are posted under a stable identity you own - the same property the GitHub App provides on the other platform. Name the token **Alokai AI Review**: the token's name becomes the bot user's display name on every comment. On a self-managed instance an administrator can also give that user an avatar (**Admin area → Users → edit the bot user**) to complete the branding. `CI_JOB_TOKEN` cannot post review comments - the job needs the project access token. ### Add the pipeline job [#add-the-pipeline-job] Add the job to `.gitlab-ci.yml`: ```yaml [.gitlab-ci.yml] ai-review: image: node:22 # With "Auto-cancel redundant pipelines" (on by default), a new push # cancels the in-flight review - same as the GitHub workflow's concurrency group. interruptible: true rules: - if: '$CI_PIPELINE_SOURCE != "merge_request_event"' when: never - if: '$AI_REVIEW_ENABLED != "true"' when: never - if: "$CI_MERGE_REQUEST_TITLE =~ /^Draft:/" when: never # Skip a single MR by adding the skip-ai-review label. - if: "$CI_MERGE_REQUEST_LABELS =~ /(^|,)skip-ai-review(,|$)/" when: never # Automated/bot MRs - adjust the prefixes to the bots you use. - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^(dependabot|renovate)\//' when: never - when: on_success script: # Authenticate to the Alokai npm registry. Skip these two lines if your # CI setup already writes the registry auth before yarn install. - npx -y npm-cli-login -u "$NPM_USER" -p "$NPM_PASSWORD" -e "$NPM_EMAIL" -r https://npm.alokai.cloud --config-path .npmrc - echo '@alokai:registry=https://npm.alokai.cloud' >> .npmrc - yarn install --frozen-lockfile - yarn alokai plugins link node_modules/@alokai/cli-plugin-review - yarn alokai ai sync - | ARGS=(--pr "${CI_MERGE_REQUEST_IID}" --repo "${CI_PROJECT_PATH}" --host "${CI_SERVER_URL#*://}") if [[ -n "${AI_REVIEW_BASE_URL}" ]]; then ARGS+=(--base-url "${AI_REVIEW_BASE_URL}"); fi if [[ -n "${AI_REVIEW_MODEL}" ]]; then ARGS+=(--model "${AI_REVIEW_MODEL}"); fi if [[ "${AI_REVIEW_INCREMENTAL}" == "true" ]]; then ARGS+=(--incremental); fi yarn alokai ai review "${ARGS[@]}" ``` `--host "${CI_SERVER_URL#*://}"` - the server URL with its scheme stripped - keeps a nonstandard port, which `CI_SERVER_HOST` alone would drop. ### Add CI/CD variables [#add-cicd-variables] In **Settings → CI/CD → Variables**, add everything from [Configuration](#configuration) - `AI_REVIEW_API_KEY` masked - plus: | Name | Kind | Value | | --------------------------------------- | --------------------- | ----------------------------------------------------------------- | | `GITLAB_TOKEN` | Masked | The project access token. Comments are posted under its bot user. | | `NPM_USER`, `NPM_PASSWORD`, `NPM_EMAIL` | `NPM_PASSWORD` masked | Alokai npm registry credentials for the auth step in the job. | The CLI reads `GITLAB_TOKEN` from the environment under exactly that name, so CI/CD variables reach it without ever putting the token on the command line. Leave `AI_REVIEW_ENABLED` unset for now. ### Enable it and check the first run [#enable-it-and-check-the-first-run-1] Set `AI_REVIEW_ENABLED` to `true`, then open a merge request (or push to an open one) and check its **Pipelines** tab: * **No `ai-review` job at all** - one of the `rules` matched: `AI_REVIEW_ENABLED` isn't `true`, the MR title starts with `Draft:`, it carries the `skip-ai-review` label, or the source branch matches a bot prefix. * **The job runs** - findings appear as merge request discussions within a minute or two, posted by the **Alokai AI Review** bot user. If the job fails, see [Troubleshooting](/ai-coding-support/troubleshooting#the-ai-review-job-fails-or-posts-nothing). #### Fixing findings from a merge request comment [#fixing-findings-from-a-merge-request-comment] On GitHub the `/fix` command is a second turnkey workflow, because Actions can trigger on comments. GitLab pipelines can't - no `.gitlab-ci.yml` rule matches a comment event - so the same chatops takes one piece of glue you host: a webhook receiver that turns a `/fix` note into a pipeline trigger. Because the fix pushes to the MR source branch, the project access token also needs the `write_repository` scope on top of `api` - add it before wiring anything below. The shape: 1. The MR author replies `/fix` to a finding. A project webhook (**Settings → Webhooks**, subscribed to **Comments** events) calls your receiver. 2. The receiver filters the note and calls GitLab's [pipeline trigger API](https://docs.gitlab.com/ci/triggers/) with the comment's URL as a variable. 3. An `ai-fix` job in `.gitlab-ci.yml` picks up the variable and runs `yarn alokai ai fix`. The receiver is a few lines on whatever you already host functions with. In pseudo-code: ```txt on POST /ai-fix-webhook(event): require header X-Gitlab-Token == WEBHOOK_SECRET # the secret you set on the webhook require event.object_kind == "note" and event.merge_request exists require first token of event.object_attributes.note == "/fix" # Author-only, same as the GitHub workflow - and since the bot is never # the MR author, its own replies can't re-trigger a fix. require event.object_attributes.author_id == event.merge_request.author_id POST {CI_SERVER_URL}/api/v4/projects/{event.project.id}/trigger/pipeline token = TRIGGER_TOKEN # Settings → CI/CD → Pipeline trigger tokens ref = event.merge_request.source_branch variables[AI_FIX_COMMENT_URL] = event.object_attributes.url variables[AI_FIX_INSTRUCTION] = note text after "/fix" ``` And the job: ```yaml [.gitlab-ci.yml] ai-fix: image: node:22 rules: - if: '$CI_PIPELINE_SOURCE == "trigger" && $AI_FIX_COMMENT_URL' script: - npx -y npm-cli-login -u "$NPM_USER" -p "$NPM_PASSWORD" -e "$NPM_EMAIL" -r https://npm.alokai.cloud --config-path .npmrc - echo '@alokai:registry=https://npm.alokai.cloud' >> .npmrc - yarn install --frozen-lockfile - yarn alokai plugins link node_modules/@alokai/cli-plugin-review - yarn alokai ai sync - git config user.name "Alokai AI Review" - git config user.email "alokai-ai-review@noreply.${CI_SERVER_HOST}" # The fix commits and pushes to the MR source branch, which CI_JOB_TOKEN # can't do - point the remote at the project access token instead. - git remote set-url origin "https://oauth2:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" - git checkout -B "${CI_COMMIT_REF_NAME}" - | ARGS=("${AI_FIX_COMMENT_URL}") if [[ -n "${AI_FIX_INSTRUCTION}" ]]; then ARGS+=(--instruction "${AI_FIX_INSTRUCTION}"); fi if [[ -n "${AI_REVIEW_BASE_URL}" ]]; then ARGS+=(--base-url "${AI_REVIEW_BASE_URL}"); fi if [[ -n "${AI_REVIEW_MODEL}" ]]; then ARGS+=(--model "${AI_REVIEW_MODEL}"); fi yarn alokai ai fix "${ARGS[@]}" ``` The URL contract is the CLI's: a note URL fixes that one finding, the MR's own URL (pass `event.merge_request.url` instead) fixes every open finding on it. Like the GitHub command workflow, this path has no `AI_REVIEW_ENABLED` gate - it only runs when the author types `/fix`.
## Provider detection [#provider-detection] The CLI picks the provider from your git remote's host: `gitlab.com`, and self-managed instances whose hostname contains `gitlab`, are recognized as GitLab. When the hostname identifies neither platform (for example `git.acme.com`), name it explicitly - pass `--provider gitlab`, or set `AI_REVIEW_PROVIDER=gitlab`. # AI Coding Support (/ai-coding-support) When an AI coding agent works in a raw codebase, it falls back on its training data - which is months out of date and knows nothing about your project's conventions. The result is code that compiles but picks the wrong seam: overriding a unified method instead of writing a custom one, hardcoding a value the inheritance system should own, logging with `console.log` instead of the Alokai logger. Alokai ships `@alokai/ai-toolkit` to close that gap. It delivers **AI context** - agent skills plus AI-tagged documentation - straight into your project through npm, so the agents you already use answer with the conventions the framework actually enforces. ## What you get [#what-you-get] `@alokai/ai-toolkit` is a versioned npm package that ships with every Alokai storefront as a dev dependency. It carries three things: * **Skills** - focused, task-scoped guides that an agent loads on demand when it recognizes a matching task, such as middleware caching, multistore, theming, or i18n. * **Routing instructions for `AGENTS.md`** - a managed block that tells any agent how to find and use the rest of the context. * **Version-matched docs** - pages from the Alokai documentation site bundled into the package, so agents read documentation pinned to the version you have installed instead of whatever their training data remembers. Because it's a package and not a one-time file copy, the context **evolves with the product**: upgrade the toolkit and your agents pick up the latest conventions on the next install. ## What it looks like in practice [#what-it-looks-like-in-practice] Ask your agent to add a Spanish locale to the storefront. Without the toolkit, the agent improvises: it hardcodes strings, invents its own translation setup, and misses the per-locale currency wiring. With the toolkit, the agent recognizes the task, loads the i18n skill, and follows the same steps an Alokai developer would - creating the `lang/es/` translation files, registering the locale, and configuring the currency the way the framework expects. The same applies across the framework: theming, multistore overrides, custom middleware methods, logging. The agent stops guessing and starts following the conventions your project is built on. ## More than code generation [#more-than-code-generation] The same context that guides code changes makes your agent a reliable way to learn the framework. Ask it questions the way you'd ask a senior Alokai developer: * "How do I expose a custom field from the platform response on the unified product?" * "How does store inheritance work in this project?" * "What are all the places I need to touch to add a new locale?" * "Why does this project forbid `console.log` and what should I use instead?" The answers come from the version-matched docs and skills installed in your project, so they describe the framework as it works in your repository - not as your agent's training data remembers it. ## Already in your project - or one command away [#already-in-your-project---or-one-command-away] Newly generated Alokai storefronts include `@alokai/ai-toolkit` out of the box, fully synced and ready. If your project was generated before the toolkit existed, adopting it takes a single command: ```bash yarn alokai ai sync ``` Confirm the two prompts: the CLI installs the package at the version matching your ecosystem release, then adds itself to `scripts.postinstall` so the context stays in sync on every install. Either way, you can verify what your agents see by listing the synced skills: ```bash ls .claude/skills # Claude Code (ai-toolkit-* entries) ls .agents/skills # Codex, Gemini CLI, GitHub Copilot ``` ## Explore [#explore] # Syncing skills (/ai-coding-support/syncing-skills) Skills live inside the installed `@alokai/ai-toolkit` package, but your agents look for them in their own directories (`.claude/skills`, `.agents/skills`, `.cursor/skills`). The `alokai ai sync` command bridges the two - and in a generated project it runs automatically after every install, so day to day you don't need to think about it. This page answers the three questions you'll actually run into: when do I need to run sync myself, how do I control which agents get the skills, and what does sync change in my repository - and what does it never touch? ## When to run sync yourself [#when-to-run-sync-yourself] The `postinstall` hook covers the common cases - fresh clones, new machines, dependency upgrades. Reach for a manual run when: * skills look missing or stale and you want them fixed now, * you changed which agents you use and want the links to follow, * your CI installs with lifecycle scripts disabled (for example `yarn install --ignore-scripts`). ```bash yarn alokai ai sync ``` | Flag | What it does | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `--dry-run` | Report what would be synced without writing anything to disk. | | `--agents ` | Sync only the listed agents (see [Choosing which agents get skills](#choosing-which-agents-get-skills)). | | `--force` | Ignore the lockfile-hash cache and rescan skills from disk. Does **not** overwrite non-symlink entries - remove those manually. | | `--yes` / `-y` | Answer yes to all prompts. Use in CI and other non-interactive environments. | ## Choosing which agents get skills [#choosing-which-agents-get-skills] By default, sync auto-detects the agents on your machine and only writes links for those. That's convenient locally, but detection depends on what's installed: a CI runner or a teammate's fresh laptop may have no agent config directories yet, and an agent you set up later won't have been covered by earlier runs. Five agents are supported out of the box. Each reads skills from a specific directory: | Agent | Skills directory | | -------------- | ---------------- | | Claude Code | `.claude/skills` | | Codex | `.agents/skills` | | Cursor | `.cursor/skills` | | Gemini CLI | `.agents/skills` | | GitHub Copilot | `.agents/skills` | `.agents/skills` is the shared convention - Codex, Gemini CLI, and GitHub Copilot all read from it, so a single set of links there serves all three. Claude Code and Cursor read from their own dedicated directories. To make the targets independent of what's installed on a given machine, pin them in `alokai.config.json` - generated projects ship with all five pre-configured: ```json title="alokai.config.json" { "aiToolkit": { "agents": ["claude-code", "codex", "cursor", "gemini-cli", "github-copilot"] } } ``` Every run resolves the targets in this order and uses the first that yields a result: 1. **The `--agents` flag** - an explicit comma-separated list on the command line wins over everything else. 2. **The `aiToolkit.agents` config** in `alokai.config.json`. 3. **Auto-detection** - the toolkit looks for agent config directories (for example `.claude`, `.cursor`, `.codex`, `.gemini`, or `.github`) in the project or your home directory. Editing `aiToolkit.agents` in `alokai.config.json` is the durable way to change which agents get synced on every install. The `--agents` flag is for one-off overrides - for example `yarn alokai ai sync --agents claude-code,cursor` on a machine where you only use those two. ## What sync changes in your repository [#what-sync-changes-in-your-repository] Sync writes three things. All of them are regenerable, clearly marked as toolkit-owned, and safe to coexist with your own content - sync never modifies anything it didn't create. ### Skill links in agent directories [#skill-links-in-agent-directories] For every skill `` in the package, sync creates a link in each target agent directory: ```bash .claude/skills/ai-toolkit- -> node_modules/@alokai/ai-toolkit/skills/ ``` The entries are links, not copies. The skill content stays in `node_modules`, pinned to the version your lockfile resolves, so upgrading the toolkit updates what your agents read - no stale copies to clean up. Don't commit the links; they're regenerated on every install. The `ai-toolkit-` prefix marks an entry as toolkit-managed, and sync only ever touches `ai-toolkit-*` entries: it adds links for new skills, removes links for skills the package dropped, and leaves your own hand-written skills in the same directory alone. On macOS and Linux the link is a relative symlink; on Windows it's a directory junction, which doesn't require administrator privileges. ### The managed `AGENTS.md` block [#the-managed-agentsmd-block] Agents need routing instructions to know the skills and bundled docs exist. Sync maintains them as a block in your project's `AGENTS.md`, wrapped in markers, so you never have to write or update that plumbing yourself: ```md title="AGENTS.md" ... routing instructions rendered from the package ... ``` Your own content is always preserved: if `AGENTS.md` doesn't exist the file is created with just the block, if it exists without the markers the block is appended below what you wrote, and if the block is already there only the content between the markers is replaced. Don't edit between the markers - those lines are overwritten on the next sync. If sync detects manual edits inside the block, it asks before overwriting (or warns and skips with `--yes`). Put any custom guidance **outside** the markers so it survives. For Claude Code specifically, sync also creates a `CLAUDE.md` stub containing `@AGENTS.md` (if you don't already have one) so Claude picks up the same routing instructions. ### The `postinstall` hook [#the-postinstall-hook] So the links never drift after a dependency change, sync adds itself to your `package.json` (it asks first): ```json title="package.json" { "scripts": { "postinstall": "... && alokai ai sync" } } ``` Generated Alokai projects already wire this up, so a fresh `yarn install` re-syncs skills and `AGENTS.md` automatically. If links ever look wrong, [run sync again](/ai-coding-support/troubleshooting). # Troubleshooting (/ai-coding-support/troubleshooting) Most issues come down to the symlinks not being created, or `alokai ai sync` not having what it needs. The first thing to try in almost every case is a fresh sync: ```bash yarn alokai ai sync ``` If that doesn't resolve it, find your symptom below. ## Skills are missing on a fresh machine or in CI [#skills-are-missing-on-a-fresh-machine-or-in-ci] The symlinks live in your working tree but aren't meant to be committed — they're regenerated on install. On a fresh clone, a fresh machine, or a CI runner, they appear when the `postinstall` hook runs `alokai ai sync`. * If your CI skips lifecycle scripts (for example `yarn install --ignore-scripts`), run sync explicitly as a step, using `--yes` so it never blocks on a prompt: ```bash yarn alokai ai sync --yes ``` * If the postinstall hook isn't wired up at all, see [the postinstall hook](/ai-coding-support/syncing-skills) — sync offers to add it after a fresh package install. ## Symlinks don't appear on Windows [#symlinks-dont-appear-on-windows] On Windows the toolkit creates **directory junctions** rather than symlinks, which don't need administrator rights. If links are still missing: * Make sure `@alokai/ai-toolkit` is actually installed (`node_modules/@alokai/ai-toolkit` exists) — junctions point at that directory and can't be created without it. * Re-run `yarn alokai ai sync`. Use `--dry-run` first to see exactly which links it intends to create. ### Skills were committed to git and now show as missing after a Windows clone or checkout [#skills-were-committed-to-git-and-now-show-as-missing-after-a-windows-clone-or-checkout] If a teammate committed the `.claude/skills/ai-toolkit-*` / `.agents/skills/ai-toolkit-*` links to git, Windows checks them out as small plain-text files (Windows disables `core.symlinks` by default) instead of real junctions, so the AI agent can't read the skill content. `alokai ai sync` on `@alokai/cli` 2.8.0+ detects these git checkout stubs and repairs them automatically — just run: ```bash yarn alokai ai sync ``` On `@alokai/cli` \< 2.8.0, sync instead refuses with "Refusing to overwrite non-symlink" for each stub - upgrade with `yarn alokai version upgrade` and re-run sync. Avoid `rm -rf` / `Remove-Item -Recurse` on the skills directories to clear a stuck entry — those commands traverse through the junctions into `node_modules/@alokai/ai-toolkit` and can delete the real skill sources; delete the individual stub file instead. ## Skills changed but sync reports nothing to do [#skills-changed-but-sync-reports-nothing-to-do] Sync caches its skill scan keyed by your lockfile hash, so it can skip rescanning when nothing changed. If you edited skills in place or suspect the cache is stale, force a rescan: ```bash yarn alokai ai sync --force ``` ## Sync warns that it skipped installing the package [#sync-warns-that-it-skipped-installing-the-package] If `@alokai/ai-toolkit` isn't installed, sync offers to add it and **warns and skips** if you decline: > Skipping @alokai/ai-toolkit sync: install declined. Re-run `alokai ai sync` and accept the prompt, or run with `--yes` in non-interactive environments. If sync instead reports it can't match your project to a compatibility-matrix entry, run `alokai version check` (and `alokai version upgrade` if needed) so the correct toolkit version can be resolved, then sync again. ## "Refusing to overwrite non-symlink at ..." [#refusing-to-overwrite-non-symlink-at-] Sync never clobbers a real file or directory it didn't create. If a target path (for example `.claude/skills/ai-toolkit-`) already exists as a regular folder, sync refuses to replace it and reports the path. Remove that entry manually, then re-run sync so it can create the symlink. The same caution applies to cleanup: a stale `ai-toolkit-*` entry that isn't a symlink is left in place with a warning rather than deleted. Remove it by hand if you no longer need it. A small, single-line file whose content is just a path (a Windows/git checkout stub - see [above](#skills-were-committed-to-git-and-now-show-as-missing-after-a-windows-clone-or-checkout)) is repaired automatically instead of refused, both here and during cleanup. Genuine unrelated files are always left untouched — remove those by hand if you no longer need them. ## An agent isn't getting skills [#an-agent-isnt-getting-skills] If skills land for some agents but not one you expect, that agent probably wasn't among the resolved targets. Sync auto-detects agents by looking for their config directories, so an agent whose CLI you haven't set up locally won't be detected. Pin the agents you want explicitly in `alokai.config.json` so detection can't miss them: ```json title="alokai.config.json" { "aiToolkit": { "agents": ["claude-code", "codex", "cursor", "gemini-cli", "github-copilot"] } } ``` See [Choosing which agents get skills](/ai-coding-support/syncing-skills) for the full resolution order. ## Agents don't read the docs or routing block [#agents-dont-read-the-docs-or-routing-block] If an agent ignores the toolkit's guidance even though skills are linked, check the managed `AGENTS.md` block: * If sync warns that the routing template is missing, reinstall or upgrade `@alokai/ai-toolkit` — the template ships inside the package. * If you edited content **between** the `alokai:ai-toolkit` markers, sync may have kept your edits and skipped the update. Move custom guidance outside the markers and re-run sync (see [the managed block](/ai-coding-support/syncing-skills)). ## The AI review job fails or posts nothing [#the-ai-review-job-fails-or-posts-nothing] Work down this list - the symptoms are ordered by how early they cut the run short. Setup details for each variable are in [AI code review](/ai-coding-support/ai-review). * **The job never appears in the pipeline.** A gate matched: `AI_REVIEW_ENABLED` isn't `true`, the pull request is a draft (or the merge request title starts with `Draft:`), it carries the `skip-ai-review` label, or the source branch matches a bot prefix (`SKIP_BRANCHES` on GitHub, the branch rule on GitLab). * **The job fails at `alokai plugins link`.** `@alokai/cli-plugin-review` isn't in `node_modules` - add it as a dev dependency and make sure the install step ran before it. * **The job fails with a 401 from the LLM endpoint.** Check `AI_REVIEW_API_KEY`. A masked variable pasted with a trailing newline fails the same way - re-enter it. If you also set `AI_REVIEW_BASE_URL` or `AI_REVIEW_MODEL`, unset them and let the defaults apply, unless Alokai gave you project-specific values. * **The job fails with a 403, or "Resource not accessible by integration".** The identity can't write comments. On GitHub, install the app on this repository and confirm it has **Pull requests: Read & write**; on GitLab, the job needs the project access token in `GITLAB_TOKEN` - `CI_JOB_TOKEN` cannot post comments. * **The job succeeds but no comments appear.** The review found nothing to report. Remember that re-runs are incremental - once the bot has reviewed a pull request, a later run only covers what changed since then, so a re-run on an unchanged branch legitimately posts nothing. Confirm the wiring on a fresh pull request instead. * **Comments are posted by the wrong account.** On GitHub, `AI_REVIEW_APP_ID` or `AI_REVIEW_APP_PRIVATE_KEY` is missing, so the workflow fell back to the default `GITHUB_TOKEN` and comments come from `github-actions[bot]`. On GitLab, rename the project access token - its name is the bot user's display name. # 1.0 (/alokai-versions/1.0) Major · latest 1.0.2 · 20 Jun 2025 · Node `20.* || >=22.14.0` Three changes block the upgrade before you change any code. Node 18 can't install this release, enterprise packages come from a new registry host, and the five `@vue-storefront/*` core packages are gone in favour of `@alokai/connect`. That last change alone is why every published package in 1.0.0 takes a major version, so a long version table here doesn't mean a long list of API changes. Read the locale change next: the locale moves from the `vsf-locale` cookie to an `x-alokai-locale` header, and that changes server-side code in both storefronts. The two patches after 1.0.0 are small, but one of them isn't optional. If you installed a CMS or search module on 1.0.0, the install wrote release-candidate vendor pins into your own app manifests. 1.0.1 corrects those pins for new installs, but only you can correct the copies already in your manifests. ## Highlights [#highlights] ### Node 18 no longer installs - the floor is Node 20, and 22.14 in practice [#node-18-no-longer-installs---the-floor-is-node-20-and-2214-in-practice] - Impact: action - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 - Step: node-22-floor **Why:** Every published package checks the Node version on install, so your runtime decides whether you can take anything else in this release. **What changed:** The root manifest's `engines.node` moves from `^18` to `20.* || >=22.14.0`. The published packages move their own `engines.node` from `>=18` to the same range - `@alokai/connect`, `@alokai/cli` and `@vsf-enterprise/sapcc-api` among them. The release also expects `@types/node` at `^22.13.17` and `.nvmrc` / `.node-version` at `22.14.0`. **For you:** On Node 18 the install is refused, so nothing else in this release reaches you until you move the runtime. Node 20 satisfies the range, but the release records it as untested and doesn't recommend it, so move to 22.14.0 or higher. Update every CI job that pins a Node version too - otherwise the pipeline fails on the same engine check. ### Enterprise packages now come from npm.alokai.cloud [#enterprise-packages-now-come-from-npmalokaicloud] - Impact: action - Area: cli-tooling - Patch: 1.0.0 - Step: npm-registry-host **Why:** A project that still points at the old registry host can't resolve any `@alokai` or `@vsf-enterprise` version in this release. The error looks like a missing package, not a registry change. **What changed:** `.npmrc` maps the `@vsf-enterprise:` and `@alokai:` scopes to `https://npm.alokai.cloud`, replacing `https://registrynpm.storefrontcloud.io`. **For you:** Point `.npmrc` at the new host and log in against it before you install - your stored credentials belong to the old host. Until you do, none of this release's `@alokai` and `@vsf-enterprise` versions resolve, so the install fails before any code change matters. ### Five @vue-storefront/\* core packages collapse into one - @alokai/connect [#five-vue-storefront-core-packages-collapse-into-one---alokaiconnect] - Impact: action - Area: connect - Packages: @alokai/connect, @vue-storefront/next, @vue-storefront/nuxt - Patch: 1.0.0 - Step: replace-legacy-core-packages **Why:** Alokai's core shipped as five separate `@vue-storefront/*` packages. They become one package, and only the packaging changes - the names, signatures and behaviour stay the same. **What changed:** `@alokai/connect` and its subpaths replace `@vue-storefront/middleware`, `@vue-storefront/sdk`, `@vue-storefront/logger`, `@vue-storefront/unified-data-model` and `@vue-storefront/multistore`. The subpaths are `@alokai/connect/middleware`, `@alokai/connect/sdk`, `@alokai/connect/logger`, `@alokai/connect/integration-kit` and `@alokai/connect/config-switcher`. The data models and the unified method declarations are at the `@alokai/connect` root. Ten symbols and their types are on `@alokai/connect/integration-kit`, not on the root: `apiClientFactory`, `validatePassword`, `unifiedExtensionFactory`, `createUnifiedCmsExtension`, `getNormalizers`, `assignToNormalizerContext`, `mergeNormalizers`, `getApiDefinitions`, `defineAddCustomFieldsFactory` and `toContextualizedNormalizers`. `@alokai/connect` itself is at `1.0.0`. Every published integration, SDK and storefront package in this release is rebuilt against it, which is why all 62 of them take a major version. **For you:** The old package names aren't installable any more, so an untouched project doesn't build until you repoint every import. For most imports that's a find-and-replace. Multistore is the exception - its configuration changes shape, and it has a highlight of its own. ### Multistore becomes the config switcher, and its configuration changes shape [#multistore-becomes-the-config-switcher-and-its-configuration-changes-shape] - Impact: action - Area: connect - Packages: @alokai/connect - Patch: 1.0.0 - Step: multistore-config-switcher **Why:** Multistore is the one part of the move to `@alokai/connect` that isn't a rename. Its configuration object changes shape, so a project that only repoints the import doesn't compile. **What changed:** `@vue-storefront/multistore` is now `@alokai/connect/config-switcher`, and `createMultistoreExtension` is now `createConfigSwitcherExtension`. The old `fetchConfiguration` / `mergeConfigurations` / `cacheManagerFactory` object becomes a single call. Each store's settings nest one level deeper, under an `api` key. `switchStrategy: "domain"` reproduces the old behaviour. `mergeConfigurations` has no replacement and needs none. `cacheTTL`, in seconds, replaces `cacheManagerFactory`. **For you:** If you were using the multistore functionality, rewrite `multistore.config.ts` - repointing its import isn't enough. Delete the `apps/storefront-middleware/multistore` directory and its `multistore:dev` script too. ### Locale travels as the x-alokai-locale header instead of the vsf-locale cookie [#locale-travels-as-the-x-alokai-locale-header-instead-of-the-vsf-locale-cookie] - Impact: action - Area: storefront - Packages: @vue-storefront/next, @alokai/cookies-bridge - Patch: 1.0.0 - Step: await-sdk-nextjs **Why:** The locale traveled in a cookie, and a CDN isn't handed cookies, so you couldn't cache responses that depended on the locale. Carrying it in a header makes them cacheable. **What changed:** Every SDK request now carries an `x-alokai-locale` header. The middleware turns that header back into a `vsf-locale` cookie on each request, so integrations that read the cookie keep working. In `@vue-storefront/next`, `getSdk` gains a `getLocale` option. Your own server-side wrapper in `apps/storefront-unified-nextjs/sdk/index.ts` becomes async, because it resolves the locale before it builds the SDK. A project that doesn't use `@alokai/connect` gets the same conversion from `@alokai/cookies-bridge`. Install it and register `createCookiesBridgeExtension([{ header: 'x-alokai-locale', cookie: 'vsf-locale' }])` as the first entry in each integration's `extensions` list. **For you:** The cost is server-side code in Next.js. You have to await `getSdk()` everywhere on the server and pass the locale in - `sdk/index.ts`, `middleware.ts` and `components/providers.tsx` all change. ### Nuxt stops writing the locale cookie [#nuxt-stops-writing-the-locale-cookie] - Impact: action - Area: storefront - Packages: @vue-storefront/nuxt - Patch: 1.0.0 - Step: nuxt-locale-cookie **Why:** The middleware writes the locale cookie itself now. A Nuxt app that keeps writing it sets a value the middleware overwrites on every request, and keeps a cookie on the responses the header change makes cacheable. **What changed:** Nuxt stops writing the locale cookie and drops `cookieNames.locale`. **For you:** The cookie writes live in files your project owns, so remove them by hand from `localization.ts` and `composables/useLocation/useLocation.ts`. ## All changes by area [#all-changes-by-area] Every change in 1.0 has one entry here, grouped by area. The highlights, from above and from the patch sections, are here too, marked with a star. Open an area to see its changes, and open a change to read why it changed and what changed. The [upgrade guide from 0.2.0 to 1.0.2](/alokai-versions?from=0.2.0\&to=1.0.2) collects the migration steps for the whole line. ### Node 18 no longer installs - the floor is Node 20, and 22.14 in practice - Kind: changed - Impact: action - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 - Step: node-22-floor - Highlight: yes **Why:** Every published package checks the Node version on install, so your runtime decides whether you can take anything else in this release. **What changed:** `engines.node` moves to `20.* || >=22.14.0` in the root manifest (from `^18`) and in the published packages - `@alokai/connect`, `@alokai/cli` and `@vsf-enterprise/sapcc-api` among them. The release also expects `@types/node` at `^22.13.17` and `.nvmrc` / `.node-version` at `22.14.0`. **For you:** On Node 18 the install is refused. Node 20 satisfies the range but is recorded as untested, so move to 22.14.0 or higher - and update every CI job that pins a Node version too. ### Enterprise packages now come from npm.alokai.cloud - Kind: changed - Impact: action - Area: cli-tooling - Patch: 1.0.0 - Step: npm-registry-host - Highlight: yes **Why:** A project that still points at the old registry host can't resolve any `@alokai` or `@vsf-enterprise` version in this release. The error looks like a missing package, not a registry change. **What changed:** `.npmrc` maps the `@vsf-enterprise:` and `@alokai:` scopes to `https://npm.alokai.cloud`, replacing `https://registrynpm.storefrontcloud.io`. **For you:** Point `.npmrc` at the new host and log in against it - until you do, none of this release's `@alokai` and `@vsf-enterprise` versions resolve. ### Five @vue-storefront/* core packages collapse into one - @alokai/connect - Kind: changed - Impact: action - Area: connect - Packages: @alokai/connect, @vue-storefront/next, @vue-storefront/nuxt - Patch: 1.0.0 - Step: replace-legacy-core-packages - Highlight: yes **Why:** Alokai's core shipped as five separate `@vue-storefront/*` packages. They become one package, and only the packaging changes - the names, signatures and behaviour stay the same. **What changed:** `@alokai/connect` and its subpaths - `@alokai/connect/middleware`, `@alokai/connect/sdk`, `@alokai/connect/logger`, `@alokai/connect/integration-kit`, `@alokai/connect/config-switcher` - replace `@vue-storefront/middleware`, `@vue-storefront/sdk`, `@vue-storefront/logger`, `@vue-storefront/unified-data-model` and `@vue-storefront/multistore`. Ten symbols and their types are on `@alokai/connect/integration-kit`, not on the root: `apiClientFactory`, `validatePassword`, `unifiedExtensionFactory`, `createUnifiedCmsExtension`, `getNormalizers`, `assignToNormalizerContext`, `mergeNormalizers`, `getApiDefinitions`, `defineAddCustomFieldsFactory` and `toContextualizedNormalizers`. Every published package is rebuilt against `@alokai/connect`, which is why all 62 take a major version. **For you:** The old package names aren't installable any more, so an untouched project doesn't build until you repoint every import. For most imports that's a find-and-replace; multistore is the exception. ### Multistore becomes the config switcher, and its configuration changes shape - Kind: changed - Impact: action - Area: connect - Packages: @alokai/connect - Patch: 1.0.0 - Step: multistore-config-switcher - Highlight: yes **Why:** Multistore is the one part of the move to `@alokai/connect` that isn't a rename. Its configuration object changes shape, so a project that only repoints the import doesn't compile. **What changed:** `@vue-storefront/multistore` is now `@alokai/connect/config-switcher`, and `createMultistoreExtension` is now `createConfigSwitcherExtension`. Each store's settings nest one level deeper, under an `api` key. `switchStrategy: "domain"` reproduces the old behaviour, `mergeConfigurations` has no replacement and needs none, and `cacheTTL`, in seconds, replaces `cacheManagerFactory`. **For you:** If you were using the multistore functionality, rewrite `multistore.config.ts` - repointing its import isn't enough. Delete the `apps/storefront-middleware/multistore` directory and its `multistore:dev` script too. ### Locale travels as the x-alokai-locale header instead of the vsf-locale cookie - Kind: changed - Impact: action - Area: storefront - Packages: @vue-storefront/next, @alokai/cookies-bridge - Patch: 1.0.0 - Step: await-sdk-nextjs - Highlight: yes **Why:** The locale traveled in a cookie, and a CDN isn't handed cookies, so you couldn't cache responses that depended on the locale. Carrying it in a header makes them cacheable. **What changed:** Every SDK request carries an `x-alokai-locale` header. The middleware turns it back into a `vsf-locale` cookie, so integrations that read the cookie keep working. `getSdk` in `@vue-storefront/next` gains a `getLocale` option, which makes your own `apps/storefront-unified-nextjs/sdk/index.ts` wrapper async. A project that doesn't use `@alokai/connect` gets the same conversion by registering `createCookiesBridgeExtension([{ header: 'x-alokai-locale', cookie: 'vsf-locale' }])` from `@alokai/cookies-bridge` as the first entry in each integration's `extensions` list. **For you:** In a Next.js project, you have to await `getSdk()` everywhere on the server and pass the locale in - `sdk/index.ts`, `middleware.ts` and `components/providers.tsx` all change. ### Nuxt stops writing the locale cookie - Kind: changed - Impact: action - Area: storefront - Packages: @vue-storefront/nuxt - Patch: 1.0.0 - Step: nuxt-locale-cookie - Highlight: yes **Why:** The middleware writes the locale cookie itself now. A Nuxt app that keeps writing it sets a value the middleware overwrites on every request, and keeps a cookie on the responses the header change makes cacheable. **What changed:** Nuxt stops writing the locale cookie and drops `cookieNames.locale`. **For you:** Remove the locale cookie writes by hand from your own `localization.ts` and `composables/useLocation/useLocation.ts` - they live in files your project owns. ### express moves to ^4.20.0, closing a security advisory - Kind: security - Impact: none - Area: cli-tooling - Patch: 1.0.0 **What changed:** `express` moves to `^4.20.0` in every package that embeds it, `@vsf-enterprise/stripe-commercetools` included. The update fixes the vulnerability in [GHSA-qw6h-vgh9-j6wx](https://github.com/expressjs/express/security/advisories/GHSA-qw6h-vgh9-j6wx). **For you:** The upgrade brings in the fix. You have no credential to rotate and no code to change. ### axios moves to ^1.7.9 across the integration packages - Kind: changed - Impact: none - Area: cli-tooling - Patch: 1.0.0 **What changed:** `axios` moves to `^1.7.9` in 18 of the integration packages. **For you:** The new version comes inside the packages you install, so you have nothing to change. ### The middleware upload ceiling doubles to 20MB - Kind: changed - Impact: none - Area: connect - Packages: @alokai/connect - Patch: 1.0.0 **What changed:** In `@alokai/connect`, the middleware's absolute cap on uploaded file size doubles from 10MB to 20MB. **For you:** The default `maxFileSize` is still 5MB. You can now set the limit higher, but if you don't set it, you get the same limit as before. ### The mock CMS gains an injectEnvironment endpoint - Kind: added - Impact: none - Area: storefront - Packages: @vsf-enterprise/cms-mock-api - Patch: 1.0.0 **What changed:** `@vsf-enterprise/cms-mock-api` has a new `injectEnvironment` endpoint. It overwrites the predefined cms-mock configuration. **For you:** You can change the mock's configuration per run, for example in end-to-end tests. ### createAlokaiMiddleware and a Nuxt server handler append the request path headers - Kind: added - Impact: none - Area: storefront - Packages: @vue-storefront/next, @vue-storefront/nuxt - Patch: 1.0.0 **What changed:** `createAlokaiMiddleware` in `@vue-storefront/next` wraps your own Next.js middleware and registers the Alokai-specific logic. It appends `x-pathname` and `x-search` to the Next.js request object. `@vue-storefront/nuxt` has a new server middleware handler that appends the same two headers to the Nuxt request object. **For you:** Your server-side code can read the request path from `x-pathname`, instead of reconstructing it. ### getPathnameFromRequestHeaders is not in the shipped release - Kind: changed - Impact: none - Area: storefront - Packages: @vue-storefront/next - Patch: 1.0.0 **What changed:** One entry of this release announces `getPathnameFromRequestHeaders` as added to `@vue-storefront/next`, and another announces it as removed. The shipped `6.0.0` doesn't export the function. **For you:** Don't plan around `getPathnameFromRequestHeaders`. Read the pathname from the `x-pathname` header that `createAlokaiMiddleware` appends. ### defineSdkModule lets each SDK module live in its own file - Kind: added - Impact: optional - Area: storefront - Packages: @vue-storefront/next, @vue-storefront/nuxt - Patch: 1.0.0 - Step: split-sdk-modules **What changed:** With `defineSdkModule`, each SDK module can live in its own file, instead of inline in the SDK config. The files go under `sdk/modules/` in Next.js or `sdk-modules/` in Nuxt, and an `index.ts` re-exports them. A widened `defineSdkConfig` accepts those re-exported modules. **For you:** Nothing forces the layout on an existing project. But `@vsf-enterprise/module-kit` now writes installed modules in that shape, so if your config stays inline, the modules you install don't match the rest of it. ### The storefront can set the config-switcher header itself - Kind: added - Impact: none - Area: storefront - Packages: @vue-storefront/next, @vue-storefront/nuxt - Patch: 1.0.0 **What changed:** `@vue-storefront/next` re-exports `defineGetConfigSwitcherHeader` from `@alokai/connect/sdk`, and Nuxt registers it as an auto-import. The `defaultRequestConfig` of `middlewareModule` accepts a `getConfigSwitcherHeader` function. **For you:** Your storefront can set the `x-alokai-middleware-config-id` header itself, instead of relying on whatever the middleware infers. ### cms-components-utils drops lodash-es for Edge Runtime compatibility - Kind: fixed - Impact: none - Area: storefront - Packages: @vsf-enterprise/cms-components-utils - Patch: 1.0.0 **What changed:** `@vsf-enterprise/cms-components-utils` no longer depends on `lodash-es`, which doesn't work on the Edge Runtime. The package has its own kebab-case helper instead. **For you:** The package now runs on the Edge Runtime. Before, it couldn't. ### The Nuxt cart page stops throwing on jw-paginate in dev mode - Kind: fixed - Impact: action - Area: storefront - Patch: 1.0.0 - Step: jw-paginate-optimizedeps **Why:** In dev mode, the Nuxt cart page threw `SyntaxError: The requested module '/node_modules/jw-paginate/lib/jw-paginate.js' does not provide an export named 'default'`. **What changed:** The fix is a `jw-paginate` entry in the dev `optimizeDeps.include` list of `nuxt.config.ts`. That file belongs to your project, so no package in the upgrade changes it. **For you:** If you run the Nuxt storefront in dev mode, add `jw-paginate` to the dev `optimizeDeps.include` list in `nuxt.config.ts` yourself. Production builds were never affected. ### The Nuxt server middleware gains its missing h3 imports - Kind: fixed - Impact: none - Area: storefront - Packages: @vue-storefront/nuxt - Patch: 1.0.0 **What changed:** The Nuxt server middleware in `@vue-storefront/nuxt` now imports `defineEventHandler` and `getRequestURL` from `h3`. Before, these imports were missing. **For you:** The fix comes with the package version, so you have nothing to change. ### The storefront metatag content carries the current company name - Kind: changed - Impact: optional - Area: storefront - Patch: 1.0.0 **What changed:** The metatag content in both storefronts uses the current company name. **For you:** The metatags are in your own app files, so your copies keep the old name until you edit them. ### The Nuxt Tailwind preset is replaced wholesale - Kind: changed - Impact: action - Area: storefront - Patch: 1.0.0 - Step: nuxt-tailwind-preset **Why:** `packages/tailwind-config/src/nuxt.ts` is a file in your project, not a package, so the version bump doesn't update it. **What changed:** The whole Nuxt Tailwind preset in `packages/tailwind-config/src/nuxt.ts` is new. It builds on `@storefront-ui/react/tailwind-config`, with `sfTypography` as a plugin. The screen breakpoints sit under `theme.extend`. **For you:** Replace the file by hand, then run `yarn build:packages` so the apps see the new preset. ### @alokai/cli is new to your project and owns the store lifecycle - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** `@alokai/cli` is new to your project at `1.0.0`. The `store add`, `store move`, `store remove`, `store build`, `store dev`, `store start`, `store test`, `store changed`, and `store deploy` commands all run through its `alokai-cli` binary. A generated project exposes the binary as a `store` script in its root `package.json`. **For you:** The binary comes with the package. The `store` script is a line in your own root `package.json`. ### store deploy takes framework, project-name and cloud-region flags - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** `store deploy` takes `--framework`, `--project-name`, and `--cloud-region`. They take precedence over the matching `alokai.config.json` values. You can't combine them with `--all`. `store deploy` also checks for missing dependencies before it starts, instead of failing part-way through a deploy. **For you:** A deploy that would have failed halfway now fails at the start and names what's missing. ### store changed takes --deployable - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** `store changed` takes `--deployable`. With it, the report lists only the changes to deployable stores. **For you:** With `--deployable`, a store with no deployment configuration no longer appears in the report. ### store test takes --playwright-options - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** `store test` takes `--playwright-options` (`-p`), for example `alokai-cli store test --playwright-options="--project=nuxt-desktop --headed"`. A run over several stores tests them one after another, not in parallel through Turbo's pipeline. The command returns exit code 1 when it fails, and it works with `--ui`. **For you:** Your CI can now detect a failing store test run. ### Store composition reads ancestor env files and symlinks node_modules - Kind: changed - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** Store composition looks for `.env` and `.env.example` in ancestor stores before it falls back to the base apps. It creates `.env` from an overridden `.env.example` in every app. It also symlinks `node_modules` into each app under `stores/`. **For you:** Inside a store, hoisted and non-hoisted copies of a dependency no longer disagree about types. ### Adopting the CLI needs cross-env on Windows and a renamed config field - Kind: changed - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** On Windows, adopting the CLI needs `cross-env` in the project - `yarn add cross-env -W -D`. `alokai.config.json` carries `deployment.framework` instead of `deployment.frontend`. Its `$schema` points at `node_modules/@alokai/cli/lib/static/alokaiConfigSchema.json` instead of a copy checked into the repository. **For you:** Your editor reads the schema from the installed CLI, so the schema stays in step with the version you're on. ### create builds a project from the published release bundle - Kind: changed - Impact: action - Area: cli-tooling - Packages: @vsf-enterprise/storefront-cli - Patch: 1.0.0 - Step: template-flag-rename **Why:** A scaffolding pipeline that passes the old flag name to `create` breaks the next time it runs. **What changed:** `create` builds a project from the published release bundle, not from a repository checkout. Its `--inheritance-only` flag is renamed to `--template`. The new `consoleProjectName` and `cloudRegion` flags write the Console project name and cloud region into `alokai.config.json`. `add-module` installs modules at that release's version. It takes `--store-id` to name the store to install into. **For you:** If you call `create` from a script, template, or pipeline, replace `--inheritance-only` with `--template` there. The old name gets an unknown-flag error, not a warning. ### module-kit 3.0.0 removes three pieces of its authoring API - Kind: removed - Impact: action - Area: cli-tooling - Packages: @vsf-enterprise/module-kit - Patch: 1.0.0 - Step: module-kit-authoring **Why:** Schemas written against 2.1.1 use symbols that no longer exist, so they fail to compile rather than behave differently. **What changed:** The module installation context no longer has `appsDirectory` - a `store` object replaces it. `addSdkMiddlewareModule` replaces `modifySdkConfig`. `createRemoveSdkPropertyVisitor` is removed. `createAddMiddlewareModuleVisitor` emits `export const x = defineSdkModule(...)`. It passes a `headers` variable instead of the output of `getRequestHeaders()`. `modifyFile` is optional on `defineSchema`. `baseCmsSchemas` also patches the PLP and PDP imports, adds the `unifiedCms` SDK module, and fixes the Nuxt Accordion import. **For you:** If you have your own installation schemas or file visitors, update them, or they don't compile against 3.0.0. ### file-modifier handles export const and creates a missing input path - Kind: fixed - Impact: none - Area: cli-tooling - Packages: @vsf-enterprise/file-modifier - Patch: 1.0.0 **What changed:** `pushExport` handles `export const` declarations and overwrites an existing export of the same name. With `type: "javascript"`, `modifyFile` creates the `inputPath` when it's missing. **For you:** Both fixes apply the next time a module installation runs. ### storefront-cli detects @alokai/connect and keeps .gitignore and .npmrc in new projects - Kind: changed - Impact: none - Area: cli-tooling - Packages: @vsf-enterprise/storefront-cli - Patch: 1.0.0 **What changed:** The CLI detects `@alokai/connect` in a project instead of the legacy middleware package. `create` now restores `.gitignore` and `.npmrc` in the project it generates. `npm pack` leaves both out of the published bundle, so they ship with a `.template` suffix that `create` strips. **For you:** A project you generate with `create` gets its `.gitignore` and `.npmrc` intact. ### Fixes land across the CLI packages - Kind: fixed - Impact: none - Area: cli-tooling - Packages: @alokai/cli, @vsf-enterprise/storefront-cli - Patch: 1.0.0 **What changed:** `store changed` on a repository with a single commit is fixed, and so is the deployment of nested stores. The spinner no longer hides `--verbose` logs for `start` and `build`. A generated `start:standalone` script no longer ignores an existing `start` script. In dev mode, middleware and SSR URLs keep a path suffix such as `/api`. The extensions on the CLI bin scripts are fixed. The missing `defu`, `get-port-please`, and `tiny-exec` dependencies are added. **For you:** The upgrade brings in all of these fixes. ### @alokai/cli reads CONSOLE_API_URL and says more when a deploy fails - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.0 **What changed:** The CLI reads `CONSOLE_API_URL` from the environment. `deploy` prints more debug output when it fails. **For you:** You can point a deploy at a non-default Console endpoint, and a failed deploy gives you more to go on. ### sapccModule is rebuilt on middlewareModule and two cart methods are renamed - Kind: changed - Impact: action - Area: sapcc - Packages: @vsf-enterprise/sapcc-sdk - Patch: 1.0.0 - Step: sapcc-module-rewrite **Why:** A SAPCC module you built yourself from `middlewareModule` and `SapccEndpoints` didn't refresh an expired token and had no image utility. **What changed:** `sapccModule` in `@vsf-enterprise/sapcc-sdk` is built on `middlewareModule` and `SapccEndpoints`. It refreshes an expired token on its own and ships a `transformImageUrl` utility. `addCartEntry` and `updateCartEntry` are renamed to `addToCart` and `updateCart`. **For you:** Calls to the old cart method names no longer typecheck, so rename them. If you built the SAPCC module yourself, swap it for `sapccModule` to get the token refresh and the image utility. ### Per-method token modes work again in the SAPCC API - Kind: fixed - Impact: none - Area: sapcc - Packages: @vsf-enterprise/sapcc-api - Patch: 1.0.0 **What changed:** `@vsf-enterprise/sapcc-api` applies a `methodsTokenModes` map such as `{ getProduct: TokenModes.APPLICATION }`. Before this release, it ignored the map and every request used the same token. **For you:** If you set per-method token modes, they take effect with this version, so the methods you listed can now carry a different token than before. ### The Algolia adapter normalizes deeply nested categories - Kind: fixed - Impact: none - Area: commercetools - Packages: @vsf-enterprise/unified-api-commercetools - Patch: 1.0.0 **What changed:** `@vsf-enterprise/unified-api-commercetools/algolia` normalizes deeply nested categories correctly. **For you:** Category facets built from a deeply nested commercetools category tree no longer come back malformed. ### Address regions now reach the Magento API - Kind: fixed - Impact: action - Area: magento - Packages: @vsf-enterprise/unified-api-magento - Patch: 1.0.0 - Step: magento-address-regions **Why:** The unified `setCartAddress` dropped the region before it reached Magento, so Magento never checked what your storefront put in `region`. **What changed:** The unified `setCartAddress` in `@vsf-enterprise/unified-api-magento` resolves `region` and `region_id` from the `shippingAddress` argument. It passes both on to the Magento API. **For you:** A free-text or display-only region that isn't valid for that country is now rejected instead of ignored, so a call that used to succeed fails. Before you upgrade a production project, map what your address forms put into `region` to the region codes Magento accepts for that country. Addresses already stored in Magento don't gain a region. ### unified-api-sfcc picks up updated SFCC dependencies - Kind: changed - Impact: none - Area: sfcc - Packages: @vsf-enterprise/unified-api-sfcc - Patch: 1.0.0 **What changed:** `@vsf-enterprise/unified-api-sfcc` picks up updated `@vsf-enterprise/sfcc-api` and `@vsf-enterprise/sfcc-types` dependencies. **For you:** The update stays behind the unified API, which doesn't change. ### The CMS and search modules you install now pin stable vendor packages, not release candidates - Kind: fixed - Impact: action - Area: cli-tooling - Patch: 1.0.1 - Step: replace-rc-module-pins - Highlight: yes **Why:** On 1.0.0, installing a CMS or search module pinned release-candidate builds of its vendor packages in your app manifests. That's vendor code that was never meant to reach production. **What changed:** Installing one of eight modules now pins the stable releases of its vendor packages. The eight are Amplience, Bloomreach Content, Builder.io, Contentful, Contentstack, SAP SmartEdit, Storyblok, and Coveo. The pins move like this: `@vsf-enterprise/contentful-api` and `@vsf-enterprise/contentful-sdk` `6.0.0-rc.3` -> `6.0.0`, `@vsf-enterprise/amplience-api` `6.0.0-rc.3` -> `6.0.0` with `@vsf-enterprise/amplience-sdk` `4.0.0-rc.3` -> `4.0.0`, `@vsf-enterprise/bloomreach-content-manager` `2.0.0-rc.3` -> `2.0.0` with `@vsf-enterprise/bloomreach-content-sdk` `5.0.0-rc.3` -> `5.0.0`, `@vsf-enterprise/builderio-sdk` `4.0.0-rc.3` -> `4.0.0`, `@vsf-enterprise/contentstack-api` `6.0.0-rc.3` -> `6.0.0` with `@vsf-enterprise/contentstack-sdk` `5.0.0-rc.3` -> `5.0.0`, `@vsf-enterprise/smartedit-api` `3.0.0-rc.3` -> `3.0.0` with `@vsf-enterprise/smartedit-sdk` `2.0.0-rc.3` -> `2.0.0`, `@vsf-enterprise/storyblok-api` `3.0.0-rc.3` -> `3.0.0` with `@vsf-enterprise/storyblok-sdk` `2.0.0-rc.2` -> `2.0.0`, and `@vsf-enterprise/coveo-api` `3.0.0-rc.3` -> `3.0.0`. **For you:** If you added a CMS or search module while on 1.0.0, your app manifests still pin the release candidates, and the upgrade doesn't touch them. Bump them yourself. If you install one of these modules after upgrading, you get the stable versions with nothing to do. ### Project generation stops writing commercetools types into every project - Kind: changed - Impact: action - Area: cli-tooling - Patch: 1.0.1 - Step: remove-commercetools-types **Why:** Every generated project got a commercetools types package, whatever its platform. A `-types` package is how tooling and the next person to open your repository tell which platform a project integrates, so on any other platform it sent a false signal. **What changed:** Project generation no longer writes `@vsf-enterprise/commercetools-types` into `apps/storefront-middleware/package.json` for platforms other than commercetools. **For you:** A SAP Commerce Cloud, Salesforce Commerce Cloud, Magento, or BigCommerce project generated on 1.0.0 or earlier still carries the dependency, and the upgrade can't take it back. You can safely remove it: nothing outside a commercetools store's own checkout code imports it. ### Module authoring can write into an integration's middleware configuration - Kind: added - Impact: none - Area: cli-tooling - Packages: @vsf-enterprise/module-kit - Patch: 1.0.1 **What changed:** `createAddIntegrationConfigPropertiesVisitor` in `@vsf-enterprise/module-kit` adds properties to the `configuration` object in an integration's `integrations//config.ts`. For example, `createAddIntegrationConfigPropertiesVisitor('api: { uri: process.env.API_URI }')` adds that `api` entry. **For you:** If you write modules, your module's `install.js` can add its own configuration keys instead of asking developers to paste them in. ### The generated CI workflow drops a dead Node matrix and moves to a standard runner - Kind: changed - Impact: optional - Area: ci-workflows - Patch: 1.0.1 **What changed:** The generated project's `.github/workflows/continuous-integration.yml` no longer declares a `node-version: ["18.20.2"]` matrix. Nothing read that matrix: the `setup` action installs Node from `.nvmrc` through `actions/setup-node`. `runs-on` moves from `ubuntu-latest-8core` to `ubuntu-latest`, the runner every GitHub plan provides, instead of a larger-runner tier. **For you:** The upgrade doesn't touch the workflow in your project, so it keeps the unused matrix and the larger-runner label until you edit it. ### The affected-stores action reports only deployable stores - Kind: changed - Impact: optional - Area: ci-workflows - Patch: 1.0.1 **What changed:** The generated project's `.github/actions/affected-stores/action.yml` calls `store changed` with `--deployable`. A store without frontend components no longer blocks the run. The `--deployable` flag itself isn't new in this release. **For you:** The upgrade doesn't touch the action file in your project. If you want this, add `--deployable` to its `store changed` call yourself. ### A per-store lint fix script ships with newly generated projects - Kind: added - Impact: optional - Area: cli-tooling - Patch: 1.0.1 - Step: per-store-lint-script **What changed:** A newly generated project's root `package.json` has a `lint:store:fix` script, `node scripts/lint-stores.mjs`, and the `@colors/colors` devDependency it needs. `scripts/lint-stores.mjs` finds the folders to lint by reading `apps/` instead of a hardcoded list. So it also covers any app your project added. **For you:** The upgrade doesn't add this script to a project that already exists. If you want to lint a single store, add it yourself. Skip it and nothing breaks - you keep linting the whole workspace with `lint:fix`. ### The SAP ASM module writes its own asmUri configuration on install - Kind: changed - Impact: action - Area: sapcc - Patch: 1.0.1 - Step: sap-asm-endpoint **Why:** A `sap-asm` install performed before this release left the assisted service endpoints with no URI to call. **What changed:** Installing the `sap-asm` module writes `asmUri: process.env.SAPCC_ASM_API_URI` into `configuration.api` in `apps/storefront-middleware/integrations/sapcc/config.ts`. It also appends `SAPCC_ASM_API_URI` to `apps/storefront-middleware/.env.example`. **For you:** If you installed the module before this release, you have neither, and the upgrade doesn't add them. The module can't reach the assisted service endpoints until you add both yourself. ### Every alokai-cli store command works on a project with no frontend app - Kind: fixed - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.2 - Highlight: yes **Why:** On a project whose `apps/` held only the middleware, any command that read `alokai.config.json` failed, not just deployment. **What changed:** The CLI no longer throws `Default framework not found` when `apps/` holds neither `storefront-unified-nextjs` nor `storefront-unified-nuxt`. It leaves `deployment.framework` empty in the resolved store config instead. **For you:** If your project runs the middleware without a storefront app, `store build`, `store dev`, and `store deploy` now work on it. The fix is in `@alokai/cli@1.0.1`, and you get it only once you move to that version. Projects with a Next.js or Nuxt app never hit the error and see no difference. ### A newly generated project's version field is a real version number - Kind: fixed - Impact: none - Area: storefront - Patch: 1.0.2 - Highlight: yes **Why:** The `version` field of a generated project held the ecosystem tag string where a version number belongs. **What changed:** The CLI writes the version number alone into the root `package.json` of a generated project, where it used to write `"version": "@alokai/ecosystem@1.0.1"`. The same value goes to the root manifest and to every `apps/*/package.json`. **For you:** This reaches only the projects you generate from now on, never an existing project through an upgrade. If your project was generated before 1.0.2, it still has the tag string, carrying whichever version generated it. Nothing consumes it - that manifest is `private: true` - so there's nothing to repair. ### The integration boilerplate is installable for the first time - Kind: added - Impact: none - Area: cli-tooling - Packages: @alokai/boilerplate-integration - Patch: 1.0.2 **What changed:** `@alokai/boilerplate-integration` was `private: true` until this release and was never on the registry. So 1.0.1 is its first published version, not an upgrade from an earlier one. Its `engines.node` is `>=16.x`, not the workspace floor. **For you:** If you're starting your own integration, you can install the boilerplate for the first time. If you aren't, there's nothing here for you. ## Patches in 1.0.x [#patches-in-10x] ## 1.0.2 [#1-0-2] Released 2025-06-20 · patch · 2 of 66 packages moved The fix worth your attention is in `@alokai/cli`: a project whose `apps/` directory holds only the middleware can now run the store commands. The other fix is in project generation and reaches only projects created after this release. Nothing here changes a default, removes an option, or moves the Node floor. The whole upgrade is one version bump in `package.json`. ### Every alokai-cli store command works on a project with no frontend app [#every-alokai-cli-store-command-works-on-a-project-with-no-frontend-app] - Impact: none - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.0.2 **Why:** On a project whose `apps/` held only the middleware, any command that read `alokai.config.json` failed, not just deployment. **What changed:** The CLI no longer throws `Default framework not found` when `apps/` holds neither `storefront-unified-nextjs` nor `storefront-unified-nuxt`. It leaves `deployment.framework` empty in the resolved store config instead. **For you:** If your project runs the middleware without a storefront app - a headless setup, or a store you deploy middleware-first - `alokai-cli store build`, `alokai-cli store dev`, and `alokai-cli store deploy` now work on it. If you still hit the error on Alokai 1.0.1, that's because the published package wasn't bumped for the fix then. The fix is in `@alokai/cli@1.0.1`, and you get it only once you move to that version. Projects with a Next.js or Nuxt app never hit the error and see no difference. ### A newly generated project's version field is a real version number [#a-newly-generated-projects-version-field-is-a-real-version-number] - Impact: none - Area: storefront - Patch: 1.0.2 **Why:** The `version` field of a generated project held the ecosystem tag string where a version number belongs. **What changed:** The CLI writes the version number alone into the root `package.json` of a generated project, where it used to write `"version": "@alokai/ecosystem@1.0.1"`. The same value goes to the root manifest and to every `apps/*/package.json`. The app manifests already held a plain number. Apart from that field and the `@alokai/cli` version the root manifest pins, a project generated at 1.0.2 is identical to one generated at 1.0.1. **For you:** This reaches only the projects you generate from now on, never an existing project through an upgrade. If your project was generated before 1.0.2, its root `package.json` still has the tag string of the version that generated it - a project created at 1.0.0 holds `"version": "@alokai/ecosystem@1.0.0"`, not the version you're upgrading from. Nothing consumes it: that manifest is `private: true`, so yarn never validates the field, and no tooling in this release reads it. There's nothing to repair, and no step asks you to. ## 1.0.1 [#1-0-1] Released 2025-06-06 · patch · 2 of 65 packages moved Alokai 1.0.1 exists for one fix: the CMS and search modules pinned release-candidate builds of their vendor packages, and now pin the stable releases. The fix applies to installs from 1.0.1 onwards. A module you installed on 1.0.0 keeps the version it got, and you correct it by hand in your own app manifests. The SAP ASM module now writes its `asmUri` configuration for you. Four files the CLI writes at project creation also changed: the CI workflow's runner label and unused Node matrix, the affected-stores action, and a new per-store lint script. None of them reach a project that already exists. Neither does the dependency that generation stopped writing, `@vsf-enterprise/commercetools-types`, which every non-commercetools project still carries until you remove it. ### The CMS and search modules you install now pin stable vendor packages, not release candidates [#the-cms-and-search-modules-you-install-now-pin-stable-vendor-packages-not-release-candidates] - Impact: action - Area: cli-tooling - Patch: 1.0.1 - Step: replace-rc-module-pins **Why:** On 1.0.0, installing a CMS or search module pinned release-candidate builds of its vendor packages in your app manifests. That's vendor code that was never meant to reach production. **What changed:** Installing one of eight modules now pins the stable releases of its vendor packages. The eight are Amplience, Bloomreach Content, Builder.io, Contentful, Contentstack, SAP SmartEdit, Storyblok, and Coveo. The pins move like this: `@vsf-enterprise/contentful-api` and `@vsf-enterprise/contentful-sdk` `6.0.0-rc.3` -> `6.0.0`, `@vsf-enterprise/amplience-api` `6.0.0-rc.3` -> `6.0.0` with `@vsf-enterprise/amplience-sdk` `4.0.0-rc.3` -> `4.0.0`, `@vsf-enterprise/bloomreach-content-manager` `2.0.0-rc.3` -> `2.0.0` with `@vsf-enterprise/bloomreach-content-sdk` `5.0.0-rc.3` -> `5.0.0`, `@vsf-enterprise/builderio-sdk` `4.0.0-rc.3` -> `4.0.0`, `@vsf-enterprise/contentstack-api` `6.0.0-rc.3` -> `6.0.0` with `@vsf-enterprise/contentstack-sdk` `5.0.0-rc.3` -> `5.0.0`, `@vsf-enterprise/smartedit-api` `3.0.0-rc.3` -> `3.0.0` with `@vsf-enterprise/smartedit-sdk` `2.0.0-rc.3` -> `2.0.0`, `@vsf-enterprise/storyblok-api` `3.0.0-rc.3` -> `3.0.0` with `@vsf-enterprise/storyblok-sdk` `2.0.0-rc.2` -> `2.0.0`, and `@vsf-enterprise/coveo-api` `3.0.0-rc.3` -> `3.0.0`. **For you:** A module install writes those versions into your `apps/storefront-middleware/package.json` and your storefront app's `package.json` once, and never revisits them. So if you added a CMS or search module while on 1.0.0, those files still pin the release candidates, and the upgrade doesn't touch them. Bump them yourself. If you install one of these modules after upgrading, you get the stable versions with nothing to do. # 1.1 (/alokai-versions/1.1) Minor · latest 1.1.0 · 26 Jun 2025 · Node `20.* || >=22.14.0` Plan a real afternoon for this release, because every project has work to do. `storefront-middleware` becomes a composite TypeScript project, and all four apps switch from relative to absolute imports. That's an eleven-part migration you apply by hand, with no automatic path. `@alokai/cli` goes to 2.0.0 and treats a store as a template unless its `alokai.config.json` entry has a `deployment` field, so a project that changes nothing can find its stores silently reclassified as templates. Upgrading `@alokai/connect`, `@vue-storefront/next`, or `@vue-storefront/nuxt` turns on Alokai page-view metering in production: a script that sends a trace on every navigation, and two new middleware endpoints. You turn it off with an environment variable. ## Highlights [#highlights] ### Your apps must move to absolute imports, and storefront-middleware becomes a composite TypeScript project [#your-apps-must-move-to-absolute-imports-and-storefront-middleware-becomes-a-composite-typescript-project] - Impact: action - Area: storefront - Packages: @alokai/cli, @vue-storefront/eslint-config - Patch: 1.1.0 - Step: composite-middleware **Why:** Absolute imports inside `storefront-middleware` don't resolve from the apps unless the apps reference the middleware as a TypeScript project. That's why the switch to absolute imports and the composite middleware are one change. **What changed:** `storefront-middleware` declares `compilerOptions.composite: true`. `storefront-unified-nextjs` and `storefront-unified-nuxt` consume it as a TypeScript Project Reference, so absolute imports inside it resolve from both apps. `@vue-storefront/eslint-config` 5.1.0 adds a `multistore` rule group that rewrites relative imports to aliased ones. `@alokai/cli` adds `store prepare`, which generates the `paths` and `include` arrays in per-store `tsconfig.json` files. Store `tsconfig` files inherit shared configuration from the root config instead of each store carrying a private copy. **For you:** The upgrade doesn't apply any of this for you. The tsconfigs, eslint configs, `turbo.json`, and app `package.json` files are yours, so you make every edit by hand, in order, and then run `yarn lint:fix` to rewrite the imports across every app and store. Skip it and `tsc` stops resolving imports inside `storefront-middleware` from the apps, and your Playwright integration tasks run before the middleware build they now depend on. Don't stop halfway, or your build fails altogether. Making the middleware composite breaks the type check that `next build` runs, and the step's last part is what fixes it. ### Page-view metering is now on by default in production [#page-view-metering-is-now-on-by-default-in-production] - Impact: action - Area: storefront - Packages: @alokai/connect, @vue-storefront/next, @vue-storefront/nuxt, @alokai/instrumentation, @alokai/instrumentation-next-component, @alokai/instrumentation-nuxt2-module, @alokai/instrumentation-nuxt3-module - Patch: 1.1.0 - Step: page-view-metering-opt-out **Why:** Alokai measures fair-use accounting in page views, so the core packages now count them without any configuration. **What changed:** Four new packages measure page views for fair-use accounting, and the three core packages wire them in with no configuration. In the middleware, `createServer` in `@alokai/connect` registers `POST /alokai-trace`, a Prometheus page-view counter. It also registers `GET /alokai-metrics`, which serves that counter plus the `prom-client` default process metrics - heap, CPU, and event loop. In Next.js, `AlokaiProvider` in `@vue-storefront/next` renders an inline `beforeInteractive` `next/script` that POSTs to `/api/alokai-trace` on every history navigation. In Nuxt, the `@vue-storefront/nuxt` module installs a plugin that does the same from `router.beforeEach`. Both scripts switch themselves off in development. The middleware endpoints don't - `createServer` registers them in every mode. **For you:** On Alokai Cloud, you've already agreed to page-view metering, and `/alokai-metrics` is blocked at the edge. If you host the middleware yourself, it exposes `/alokai-metrics` on whatever hostname your middleware answers, in development too. If you host a storefront yourself, a production build starts sending traces. To turn it off, set the opt-out variable to `true` for each app you host yourself: `ALOKAI_IS_SELF_HOSTED` for the middleware, `NEXT_PUBLIC_ALOKAI_IS_SELF_HOSTED` for Next.js, and `NUXT_PUBLIC_ALOKAI_IS_SELF_HOSTED` for Nuxt. ### @alokai/cli 2.0.0 treats a store without a deployment field as a template [#alokaicli-200-treats-a-store-without-a-deployment-field-as-a-template] - Impact: action - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.1.0 - Step: store-deployment-field **Why:** You couldn't parametrise a template store in `alokai.config.json`, because giving a store any config at all made it a deployable store. **What changed:** A store is a template unless its `alokai.config.json` entry has a `deployment` field. Before, a store was a template only when its entry had no config at all. A template store can now be parametrised in `alokai.config.json`. **For you:** If a store you build, run, or deploy has no `deployment` field in its entry, the CLI now skips it as a template. Nothing errors - `store build`, `store dev`, and `store deploy` just stop composing it. Check every entry in `alokai.config.json` before you run anything, and add a `deployment` field to each store that isn't a template. ### @vsf-enterprise/middleware-headers 3.0.0 changes your CDN cache key and stops ignoring per-method headers [#vsf-enterprisemiddleware-headers-300-changes-your-cdn-cache-key-and-stops-ignoring-per-method-headers] - Impact: action - Area: connect - Packages: @vsf-enterprise/middleware-headers - Patch: 1.1.0 - Step: middleware-headers-cache-control **Why:** Under multistore and integration routing, the content the middleware returns depends on `x-alokai-middleware-config-id` and `x-alokai-locale`, but the `Vary` header didn't list them. **What changed:** The extension appends `x-alokai-middleware-config-id` and `x-alokai-locale` to the `Vary` header of every response it touches, merged with any `Vary` you set yourself. The top-level `cacheControl` option no longer suppresses the per-method `headers` section. A `Cache-Control` you set for a specific method now wins over the general one instead of being a no-op. **For you:** Your CDN cache key widens, so expect a lower hit rate until the new key warms up. There's nothing to change in your config for this. If you set a per-method `Cache-Control` alongside a top-level `cacheControl`, that header was silently doing nothing and now takes effect. That changes what your CDN caches, from a config you never touched. Drop the per-method header to keep what your CDN did before, or leave it to accept the new behavior. ## All changes by area [#all-changes-by-area] Every change in 1.1 has one entry here, grouped by area. The highlights, from above and from the patch sections, are here too, marked with a star. Open an area to see its changes, and open a change to read why it changed and what changed. The [upgrade guide from 1.0.2 to 1.1.0](/alokai-versions?from=1.0.2\&to=1.1.0) collects the migration steps for the whole line. ### Your apps must move to absolute imports, and storefront-middleware becomes a composite TypeScript project - Kind: changed - Impact: action - Area: storefront - Packages: @alokai/cli, @vue-storefront/eslint-config - Patch: 1.1.0 - Step: composite-middleware - Highlight: yes **Why:** Absolute imports inside `storefront-middleware` don't resolve from the apps unless the apps reference the middleware as a TypeScript project. That's why the switch to absolute imports and the composite middleware are one change. **What changed:** `storefront-middleware` declares `compilerOptions.composite: true`, and both storefront apps consume it as a TypeScript Project Reference. `@vue-storefront/eslint-config` 5.1.0 adds a `multistore` rule group that rewrites relative imports to aliased ones. `@alokai/cli` adds `store prepare` to generate the `paths` and `include` arrays in per-store `tsconfig.json` files, and store `tsconfig` files inherit shared configuration from the root config. **For you:** The upgrade doesn't apply any of this for you - you edit the tsconfigs, eslint configs, `turbo.json`, and app `package.json` files by hand, in order. Don't stop halfway, or your build fails: making the middleware composite breaks the type check that `next build` runs. ### Page-view metering is now on by default in production - Kind: added - Impact: action - Area: storefront - Packages: @alokai/connect, @vue-storefront/next, @vue-storefront/nuxt, @alokai/instrumentation, @alokai/instrumentation-next-component, @alokai/instrumentation-nuxt2-module, @alokai/instrumentation-nuxt3-module - Patch: 1.1.0 - Step: page-view-metering-opt-out - Highlight: yes **Why:** Alokai measures fair-use accounting in page views, so the core packages now count them without any configuration. **What changed:** `createServer` in `@alokai/connect` registers `POST /alokai-trace` and `GET /alokai-metrics` on your middleware. `AlokaiProvider` in `@vue-storefront/next` renders an inline `beforeInteractive` `next/script` that POSTs to `/api/alokai-trace` on every history navigation. The `@vue-storefront/nuxt` module installs a plugin that does the same from `router.beforeEach`. Both scripts switch themselves off in development, but the middleware endpoints don't. **For you:** On Alokai Cloud, you've already agreed to page-view metering, and `/alokai-metrics` is blocked at the edge. A middleware you host yourself exposes `/alokai-metrics` on your own hostname, and a storefront you host yourself sends traces from a production build, until you set the opt-out variable to `true` for each app you host yourself: `ALOKAI_IS_SELF_HOSTED` for the middleware, `NEXT_PUBLIC_ALOKAI_IS_SELF_HOSTED` for Next.js, and `NUXT_PUBLIC_ALOKAI_IS_SELF_HOSTED` for Nuxt. ### @alokai/cli 2.0.0 treats a store without a deployment field as a template - Kind: changed - Impact: action - Area: cli-tooling - Packages: @alokai/cli - Patch: 1.1.0 - Step: store-deployment-field - Highlight: yes **Why:** You couldn't parametrise a template store in `alokai.config.json`, because giving a store any config at all made it a deployable store. **What changed:** A store is a template unless its `alokai.config.json` entry has a `deployment` field. Before, a store was a template only when its entry had no config at all. **For you:** If a store you build, run, or deploy has no `deployment` field in its entry, the CLI now skips it as a template. Nothing errors - `store build`, `store dev`, and `store deploy` just stop composing it. ### @vsf-enterprise/middleware-headers 3.0.0 changes your CDN cache key and stops ignoring per-method headers - Kind: changed - Impact: action - Area: connect - Packages: @vsf-enterprise/middleware-headers - Patch: 1.1.0 - Step: middleware-headers-cache-control - Highlight: yes **Why:** Under multistore and integration routing, the content the middleware returns depends on `x-alokai-middleware-config-id` and `x-alokai-locale`, but the `Vary` header didn't list them. **What changed:** The extension appends `x-alokai-middleware-config-id` and `x-alokai-locale` to `Vary` on every response it touches, merged with any `Vary` you set yourself. The top-level `cacheControl` option no longer suppresses the per-method `headers` section, so a `Cache-Control` set for a specific method now wins over the general one. **For you:** Your CDN cache key widens, so expect a lower hit rate until it warms up. A per-method `Cache-Control` you set alongside a top-level `cacheControl` was silently doing nothing and now takes effect - drop it to keep what your CDN did before, or leave it to accept the new behavior. ### context.getApiClient is typed as returning a promise - Kind: changed - Impact: action - Area: connect - Packages: @alokai/connect - Patch: 1.1.0 - Step: await-get-api-client **Why:** Federated code could call `context.getApiClient` without `await` and still typecheck. The call always returned a promise at runtime, so that code was already broken. **What changed:** `context.getApiClient` in `@alokai/connect`'s `MiddlewareContext` is typed as returning `Promise`. **For you:** If you call `context.getApiClient` in a custom middleware method or extension, add `await` to every call. An unawaited call that used to typecheck now fails `tsc`. ### The config switcher falls back to the default config id - Kind: changed - Impact: none - Area: connect - Packages: @alokai/connect - Patch: 1.1.0 **What changed:** `@alokai/connect/config-switcher` accepts a request with no config header at all and uses the default config id. Before, it required the header. **For you:** A request that used to be rejected for a missing header now resolves against the default config. ### dotenv is gone from the Connect logger - Kind: removed - Impact: none - Area: connect - Packages: @alokai/connect - Patch: 1.1.0 **What changed:** `@alokai/connect/logger` no longer depends on `dotenv`, so you can use the logger in React Native projects. A project generated at 1.1.0 declares `dotenv` `16.4.7` directly in `apps/storefront-middleware/package.json` instead. **For you:** You don't need to add it. Your root `package.json` has carried `"dotenv": "16.4.7"` in `dependencies` all along, so the `import 'dotenv/config'` in your middleware keeps resolving through the workspace root. ### Nuxt hydration warnings on the size and colour chips and the checkout layout are fixed - Kind: fixed - Impact: optional - Area: storefront - Patch: 1.1.0 **What changed:** The size filter chips in `components/CategoryFilters/FilterSize.vue` and the product page's size and colour chips in `components/ProductAttributes/ProductAttributes.vue` get real `id`/`for` pairs. `layouts/checkout.vue` wraps the checkout layout's loader and slot in ``. Together, they stop the hydration warnings in `storefront-unified-nuxt`. **For you:** These files belong to your project, so your copies keep the old markup until you port the change. ### The no-JavaScript price fallback is dropped from the Nuxt product cards - Kind: removed - Impact: optional - Area: storefront - Patch: 1.1.0 **What changed:** `components/ui/ProductCard/ProductCard.vue` and `components/ui/PurchaseCard/PurchaseCard.vue` no longer carry the `