Overview
The VulnZap client library allows you to integrate vulnerability scanning directly into your Node.js applications and tools.Installation
Install the VulnZap client library using npm:Setup and Configuration
Prerequisites
- Node.js 18 or higher
- VulnZap API key from your dashboard
Basic Setup
Set your API key as an environment variable:Custom API Base URL
If you are using a self-hosted VulnZap instance:Security Assistant
The Security Assistant is designed for AI coding agents and development environments that need real-time security feedback. It monitors a directory for file changes and automatically performs incremental vulnerability scans.How It Works
- Watches a specified directory recursively for file changes
- Automatically excludes common non-code files (node_modules, .git, .md, .DS_Store, .lock files)
- Tracks whether files are new or modified
- Sends changed files to the backend for incremental scanning
- Maintains session state with automatic timeout management
Basic Usage
Retrieving Security Assistant Results
Stopping Security Assistant
Commit Scanning
Scan individual commits for vulnerabilities. This is ideal for CI/CD pipelines and pre-commit hooks. Results are delivered through event handlers (“update”, “completed”, “error”) or can be retrieved later usinggetCompletedCommitScan(jobId).
Basic Commit Scan
Repository Scanning
Scan an entire repository for vulnerabilities. The backend will clone and analyze the repository. Results are delivered through event handlers (“update”, “completed”, “error”) or can be retrieved later usinggetCompletedCommitScan(jobId).