WebyBroWebyBrodocsDashboard
Documentation menu

The CLI

webybro on npm: install the tracker with webybro init, sign in with wb login, read stats from the terminal.

Install

terminal
npm i -g webybro   # installs the wb command
# or one-off, no install:
npx webybro <command>

wb init: install the tracker

Run it in your project folder. It detects the framework, asks for your tracking key, writes the snippet into the right file, prints which file it changed, and tells you what to do next. Idempotent: a project that already carries the snippet is left alone.

terminal
npx webybro init

# non-interactive (CI, scripts):
npx webybro init --key wb_pk_… --framework nextjs-app --yes

Detected frameworks: Next.js (App and Pages Router), TanStack Start, React, Vue, Nuxt, SvelteKit, Remix, Astro, Gatsby, WordPress and plain HTML. The installation guides show what it writes, per framework.

Signing in and reading stats

terminal
wb login                 # OAuth device flow: a code, a browser approval
wb sites                 # the sites your account can read
wb stats --site my-site  # totals; add --from/--to as ISO instants
wb logout
  • Sign-in is the OAuth device flow: the CLI never sees your password, and the grant is revocable any time from Account, Connected apps.
  • Credentials live in ~/.config/wb/credentials.json, restricted to your user (0600), and the CLI says out loud if the filesystem refused the restriction.
  • The CLI is read-only by design: its scopes are site:read analytics:read realtime:read revenue:read, and nothing it can do mutates a site.

Pointing it elsewhere

WB_API_URL overrides the API base for self-hosted or staging deployments; --api does the same per invocation. JSON output for scripts: every read command takes --json.