JavaScript SDK

The Deep Security JavaScript SDK consists of a JavaScript library that you can use to develop JavaScript client programs that execute on the NodeJS runtime. The SDK simplifies the development of JavaScript clients that interact with Deep Security API endpoints.

If you prefer, your JavaScript clients can interact with the API endpoints directly using the NodeJS HTTP core module, or using other 3rd-party libraries such as Request, SuperAgent, or the promise-based axios module. If you are not a programmer, or you want to quickly explore API endpoints, you can use the API directly via tools such as Postman and curl.

For guidance on using the SDK, see First Steps Toward Deep Security Automation. Also see the API Reference.

To provide you with the JavaScript SDK as early as possible, we are temporarily releasing it as a download that you manually add to your local package repository. We will update this page when the SDK is available on a public repository.

Supported software

The JavaScript SDK supports ECMAScript 2015 Language (ES6) with promises.

You should use the latest LTS version of NodeJS. We do not support versions of NodeJS for which LTS has ended.

Get set up to use the JavaScript SDK

Prerequisites

Install the following software:

We recommend Yarn as the package manager for installing and upgrading the JavaScript SDK in your local package repository. Yarn is specifically effective for unlinking projects from locally-installed packages. Of course, if you are accustomed to using a different package manager you can use that.

Download and install the JavaScript SDK

Download the SDK and set it up as a JavaScript runtime dependency for your NodeJS JavaScript project.

  1. Download the JavaScript SDK.
  2. Extract the dsm-js-sdk.zip file.
  3. Open Command Line or Terminal and change the current directory to the directory of the extracted contents.
  4. Enter the following command to install dependencies:
    yarn install
  5. Enter the following command to create a symbolic link from the repository to the package in the SDK directory:
    yarn link

    You should see output that is similar to the following example:

    yarn link v1.6.0
    success Registered "@trendmicro/deepsecurity".
    info You can now run `yarn link "@trendmicro/deepsecurity"` in the projects where you want to use this package and it will be used instead.
    Done in 0.05s.

Create a symbolic link from your JavaScript client project to the @trendmicro/deepsecurity package.

  1. Open Command Line or Terminal and change the current directory to the root directory of your NodeJS project.
  2. Enter the following command:
    yarn link "@trendmicro/deepsecurity"

    You should see output that is similar to the following example:

    yarn link v1.6.0
    success Using linked package for "@trendmicro/deepsecurity".
    Done in 0.06s.

For more information about the yarn link command, see the Yarn link documentation.

Upgrade the JavaScript SDK

If your project is linked to the @trendmicro/deepsecurity package and you want to use a newer release of the package, remove the links that you set up for the previous version. After you remove the links, you can install the newer package and set up links as you did for the previous package.

  1. Open Command Line or Terminal and change the current directory to your project directory.
  2. Enter the following command:
    yarn unlink "@trendmicro/deepsecurity"

    You should see output that is similar to the following example:

    yarn unlink v1.6.0
    success Removed linked package "@trendmicro/deepsecurity".
    info You will need to run `yarn` to re-install the package that was linked.
    Done in 0.12s.
  3. Change the current directory to the directory where you extracted the JavaScript SDK archive.
  4. Enter the following command:
    yarn unlink

    You should see output that is similar to the following example:

    yarn unlink v1.6.0
    success Unregistered "@trendmicro/deepsecurity".
    info You can now run `yarn unlink "@trendmicro/deepsecurity"` in the projects where you no longer want to use this package.Done in 0.05s.
  5. To upgrade the package, use the steps in the previous sections to download and install the SDK and link your project to the package.

For more information about the yarn unlink command, see the Yarn unlink documentation.