Skip to content
Get started

Installation

Vega has two parts: the vega CLI, which builds and deploys your project, and @vega/sdk, the library your code imports. Both follow semver; the CLI is on the 3.x line and the SDK on 2.x.

  • Node.js 22 or later
  • npm, pnpm, or yarn
  • A Vega account (the Free tier includes 100k requests/month across 3 regions)

Install the CLI globally so vega is available in any project:

Terminal window
npm install -g @vega/cli

Verify the install:

Terminal window
vega --version
Terminal window
vega 3.1.0
Terminal window
vega login

This opens your browser to complete sign-in, then stores a scoped token in ~/.vega/credentials. In CI, set the VEGA_TOKEN environment variable instead — see Deployments.

vega init scaffolds a TypeScript project and links it to your account:

Terminal window
vega init acme-api
cd acme-api

The generated project is intentionally small:

acme-api/
├── api/
│ └── index.ts # your app — routes, handlers, middleware
├── vega.json # project link and build entry
├── package.json
└── tsconfig.json

vega.json holds the project binding; everything else — regions, caching, error handling — is configured in code:

vega.json
{
"project": "acme-api",
"entry": "api/index.ts"
}

Already have a repository? Install the SDK directly and add a vega.json with an entry pointing at the file that exports your app:

Terminal window
npm install @vega/sdk
Terminal window
vega dev

vega dev serves your app at http://localhost:7700 with the same runtime, cache, and tracing behavior you get in production. Edits rebuild in well under a second.