CI/CD integration
Shoplazza CLI supports non-interactive authentication and automation for CI/CD pipelines.
Authentication in CI/CD
Use a User Access Token (UAT) for non-interactive authentication:
shoplazza auth login --uat $SHOPLAZZA_UAT --store-domain $SHOPLAZZA_STORE
Or set environment variables (no explicit login required):
export SHOPLAZZA_UAT=your-token
export SHOPLAZZA_STORE=my-store.myshoplaza.com
GitHub Actions example
name: Deploy App
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Shoplazza CLI
run: npm install -g shoplazza-cli
- name: Authenticate
run: shoplazza auth login --uat ${{ secrets.SHOPLAZZA_UAT }} --store-domain ${{ secrets.SHOPLAZZA_STORE }}
- name: Deploy
run: shoplazza app deploy
GitLab CI example
deploy:
image: node:20
stage: deploy
script:
- npm install -g shoplazza-cli
- shoplazza auth login --uat $SHOPLAZZA_UAT --store-domain $SHOPLAZZA_STORE
- shoplazza app deploy
only:
- main
Environment variables
| Variable | Description |
|---|---|
SHOPLAZZA_UAT | User Access Token for authentication |
SHOPLAZZA_STORE | Store domain (e.g. my-store.myshoplaza.com) |
Best practices
- Store secrets securely — Use your CI/CD platform's secret management, never commit tokens
- Use minimal scopes — Request only the scopes needed for your deployment workflow
- Pin CLI version — Use
npm install -g [email protected]for reproducible builds - Dry run first — Test with
--dry-runin staging before deploying to production