Socket
Socket
Sign inDemoInstall

zaproxy

Package Overview
Dependencies
9
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zaproxy

ZAP API Client for Node.js


Version published
Weekly downloads
5.5K
increased by34.88%
Maintainers
3
Install size
2.38 MB
Created
Weekly downloads
 

Changelog

Source

[2.0.0-rc.3] - 2023-10-14

Changed

  • Update core APIs for 2.14.

Readme

Source

zap-api-nodejs logo

ZAP Node API



License Known Vulnerabilities



The NodeJS implementation to access the ZAP API. For more information about ZAP consult the (main) ZAP project.

Install

npm install zaproxy

Usage

By default ZAP requires an API key to be sent with every request. This is done automatically providing you supply the same API key when you instantiate the ZapClient that you use to run ZAP with. All following API requests will use this same API key.
You can disable the API key when running ZAP if you are on a trusted network and understand the risks. If you choose to do so, you may omit the apiKey property of the zapOptions object supplied to ZapClient.

Instantiate the Node API:

const ZapClient = require('zaproxy');

const zapOptions = {
  apiKey: 'eahhr6h6kal92j21gkcnhkp80t',
  proxy: {
    host: '127.0.0.1',
    port: 8080,
  },
};

const zaproxy = new ZapClient(zapOptions);

Use the Node API:

let params = {
  contextid: contextid,
  userid: userid,
  url: sutbaseurl,
  maxchildren: maxchildren,
  recurse: recurse,
  subtreeonly: subtreeonly,
};
let response = await zaproxy.spider.scanAsUser(params);
console.log(response);

Encountering Errors

When encountering an error, like attempting to retrieve a non-existent context, a rejected promise will be returned. The rejection will contain an ApiClientError object, which encapsulates the specific details of the original error. This ApiClientError object offers valuable information regarding the failed request, and the original error can be accessed through the cause property. The response details, if any, are available through the response property, containing the status and data (body).

API

For a full API list, see https://www.zaproxy.org/docs/api/.

Getting Help

For help using the ZAP API refer to:

Issues

To report issues related to the ZAP Node API, bugs and enhancements requests, use the issue tracker of this project.

Keywords

FAQs

Last updated on 14 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc