Read Virent analytics and check installs from a terminal.
Last reviewed 2026-10-27
The Virent CLI wraps the public API for scripts, CI jobs and AI coding agents. Every command prints JSON.
Install#
npx @virent.app/cli --helpOr install it globally for the virent command:
npm install --global @virent.app/cliIt needs Node.js 20 or later and has no dependencies.
Read analytics#
Reading analytics needs a private API key (vnt_sk_) from Settings → Connection on a plan that includes the read API. See Keys and secrets.
export VIRENT_API_KEY=vnt_sk_…virent analytics overview --website <website-id>virent analytics pages --website <website-id> --from 2026-10-01 --to 2026-10-27virent analytics timeseries --website <website-id> --interval hour --from 2026-10-26| Report | What it returns |
|---|---|
overview | Human analytics totals: pageviews, events, sessions, bounces and visitors |
timeseries | Pageviews and sessions per hour or day |
traffic | Totals, time series and goal conversions in one call |
pages | Pageviews per page path |
referrers | Sessions per referrer and traffic source, including AI referrers |
visitors | Visitors by browser, device, operating system and country |
The range defaults to the last 7 days. --timezone takes an IANA time zone and defaults to UTC. Each report is one operation in the OpenAPI specification.
Check an install#
Validate a publishable key (vha_pk_) against a page on your site:
virent install check --key vha_pk_… --url https://www.example.com/The CLI sends one pageview to browser ingest with dryRun=1 from that page's origin. Virent checks the key, the allowed origin and host, the plan and the rate limits, and stores nothing. A validated event means the browser script with that key will be accepted on that site.
Other commands#
| Command | What it does |
|---|---|
virent openapi | Prints the OpenAPI 3.1 description of the public API |
virent --version | Prints the CLI version |
virent --help | Lists commands and options |
Errors go to stderr with exit code 1. They include the API's error message and, when rate limited, the Retry-After seconds. --base-url (or VIRENT_API_URL) points the CLI at another Virent origin.
Use with AI agents#
Coding agents can run the CLI directly. Give the agent the key through VIRENT_API_KEY in its environment, never in a chat message, and ask it to run virent --help first.
API and SDK Reference
Virent SDKs, keys and the OpenAPI specification for browser analytics ingest, AI crawler ingest and the analytics read API.
First-party analytics
Relay the Virent browser script and events through your own domain under /_vr, with the headers Virent needs, for Next.js, nginx, Cloudflare Workers and other reverse proxies.