Build a checkout extension
This tutorial builds a checkout extension end to end — scaffold, develop, push a version, then activate it. checkout is an alias for checkout-extension.
Prerequisites
- Shoplazza CLI installed — see Install
- Authenticated — see Authentication
- Node.js 14.18.0 or later on your
PATH(dev,buildandpushrun the bundled Vite toolchain through Node; the first run installs the project's npm dependencies)
1. Scaffold the project
init creates a project directory with a first extension (local, no network):
shoplazza checkout init --name my-project --extension my-ext
cd my-project
To add more extensions later, run shoplazza checkout create --name another-ext inside the project.
2. Develop with live reload
Start the dev server (rebuild + HMR on port 8888):
shoplazza checkout dev --extension-name my-ext
Develop several at once with --extension-name ext1,ext2, or all of them with --all.
3. Build
shoplazza checkout build --name my-ext
4. Push a version
push builds and uploads a new version but does not activate it:
shoplazza checkout push --name my-ext
Optionally set the version explicitly (it must be greater than the last pushed version):
shoplazza checkout push --name my-ext --version 1.1
5. Activate it
Find the server-side extension id and its versions:
shoplazza checkout list --all
shoplazza checkout versions --extension-id abc123
Then activate the version with deploy:
shoplazza checkout deploy --extension-id abc123 --version 1.1
In a terminal, you can leave off --extension-id and --version and pick the extension and its version from a list instead. deploy asks you to confirm before the version replaces the live checkout extension.
Add --dry-run to deploy, undeploy, preview, and versions to print the request without sending it.
6. Preview
Generate a shareable preview URL for a version:
shoplazza checkout preview --extension-id abc123 --version 1.1