Installation
Install the right Vanta SDK and connect your application to the API.
Choose an SDK
Vanta ships separate SDKs so each environment gets idiomatic APIs without pulling in code it does not need. Pick the one that matches where your code runs.
- Node.js (
@vanta-dev/node) for servers, scripts, CLIs, and any backend process. - Web browser (
@vanta-dev/web) for plain browser JavaScript. - React (
@vanta-dev/react) for React applications that want bundled hooks and providers. - Next.js (
@vanta-dev/next) for Next.js apps, with support for server components and route handlers.
Install
Use npm (or your preferred package manager) to add the SDK to your project. The package name matches the environment you chose above.
Node.js
bash
npm install @vanta-dev/nodeWeb browser
bash
npm install @vanta-dev/webReact
bash
npm install @vanta-dev/reactNext.js
bash
npm install @vanta-dev/nextSet your API key
Each project has its own API key. Create a project in the dashboard to get one, then store the key in an environment variable named VANTA_API_KEY.
bash
export VANTA_API_KEY=vk_xxxxxxxxxxxxxxxxCreate a client
Import the SDK and construct a client with your key. This example uses the Node.js SDK; instantiate the equivalent from whichever package you installed.
typescript
import { Vanta } from '@vanta-dev/node'
const vanta = new Vanta({
apiKey: process.env.VANTA_API_KEY,
})