Skip to content
These docs describe staging.zkao.io and the @zksecurity/zkao-cli@next release. For production, see docs.zkao.io.

Environments

View .md

zkao runs two public environments:

Environment App API base Docs
Production zkao.io https://zkao.io/api/v1 docs.zkao.io
Staging staging.zkao.io https://staging.zkao.io/api/v1 docs.staging.zkao.io

The CLI and SDK target production by default. Staging runs ahead of production and gets new features first. Its data and tokens are separate: a production token does not work on staging.

One environment variable, ZKAO_URL, points the CLI and SDK at an environment. It accepts any of these forms:

Terminal window
ZKAO_URL=staging.zkao.io
ZKAO_URL=https://staging.zkao.io
ZKAO_URL=https://staging.zkao.io/api/v1

All three resolve to https://staging.zkao.io/api/v1. A bare host gets https://. A value that already ends in /api/v1 is used as is.

The CLI’s --base-url flag and the SDK’s baseUrl option are used verbatim, with no normalization. They win over ZKAO_URL.

The CLI and SDK ship on two npm dist-tags:

  • latest matches production.
  • next matches staging. Its versions look like X.Y.Z-next.N.

Install the staging channel when you work against staging:

Terminal window
npm install -g @zksecurity/zkao-cli@next

Or pass --next to the install script:

Terminal window
curl -fsSL https://raw.githubusercontent.com/zksecurity/zkao-sdk/main/install.sh | bash -s -- --next

A CLI from the next channel checks the next tag for updates, and a latest CLI checks latest.

Set ZKAO_URL when you log in:

Terminal window
ZKAO_URL=staging.zkao.io zkao login --project <projectId>

Each saved project remembers the base URL it was approved on. After that, you no longer need ZKAO_URL for that project.

Switching between projects and environments

Section titled “Switching between projects and environments”
Terminal window
zkao config show # every saved project, with its base URL
zkao config use <projectId> # make another saved project active

Switching to a staging project points the CLI at staging. Switching back to a production project points it at production.

To log in to the other environment, pass ZKAO_URL again. Without it, zkao login targets the active project’s environment.