Skip to main content
The Veto Node.js SDK (@useveto/node) lets you add runtime authorization to any Node.js application or MCP server.

Requirements

  • Node.js 18 or later (the SDK uses the native fetch API built into Node.js 18+)
  • A Veto API key — get one from the Veto dashboard

Install the package

npm install @useveto/node

Import the SDK

import { VetoClient } from "@useveto/node";

Exported names

The SDK exports the following from @useveto/node: Classes and functions
  • VetoClient — the main client for all Veto API operations
  • createVetoGuard — higher-order wrapper for MCP tool handlers (recommended)
  • vetoMiddleware — manual guard function for MCP tool handlers
  • VetoError — base error class
  • UnauthorizedError — thrown on invalid or expired API keys
  • RateLimitError — thrown when rate limits are exceeded
Types
  • VetoClientOptions, CreateAgentInput, CreatePolicyInput, UpdatePolicyInput, AuditLogFilters
  • VetoMcpOptions, McpToolResponse
  • Agent, Policy, PolicyRule, AuthorizationRequest, AuthorizationResult, AuditLogEntry
  • ParameterConstraint, RateLimitConfig, TimeWindowConfig
  • AgentStatus, AuthorizationOutcome, ApiKey, ErrorCode
Constants
  • ErrorCodes, DefaultRateLimits, Defaults

Next steps

VetoClient

Learn how to initialize the client and call every method.

MCP Integration

Add authorization to your Model Context Protocol server.