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.
Requirements
Section titled “Requirements”- 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
Section titled “Install the CLI”Install the CLI globally so vega is available in any project:
npm install -g @vega/cliVerify the install:
vega --versionvega 3.1.0Authenticate
Section titled “Authenticate”vega loginThis 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.
Create a project
Section titled “Create a project”vega init scaffolds a TypeScript project and links it to your account:
vega init acme-apicd acme-apiThe 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.jsonvega.json holds the project binding; everything else — regions, caching, error handling — is configured in code:
{ "project": "acme-api", "entry": "api/index.ts"}Add the SDK to an existing project
Section titled “Add the SDK to an existing project”Already have a repository? Install the SDK directly and add a vega.json with an entry pointing at the file that exports your app:
npm install @vega/sdkRun locally
Section titled “Run locally”vega devvega 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.
Next steps
Section titled “Next steps”- Deploy your first endpoint in the Quickstart
- Understand apps, regions, and deployments in Core concepts