Use the TrendAI™ Vision One™ File Security Node.js SDK to scan files for malware.
The Node.js SDK for
TrendAI™ Vision One™ File Security empowers you to craft applications which seamlessly integrate
with File Security. With this SDK you can perform a thorough scan of data and artifacts
within your applications to identify potential malicious elements.
Follow the steps below to set up your development environment and configure your
project, laying the foundation to effectively use File Security.
Prerequisites
Before installing the SDK, ensure you have the following:
-
TrendAI™ Vision One account associated with your region
-
Configure custom user roles with File Security permissions
When you have all the prerequisites, continue with creating an API key.
Create an API key
The File Security SDK requires a valid API key provided as a parameter to the SDK
client object.
TrendAI™ Vision One API keys are associated with different regions. Refer to the region flag below to obtain a better understanding of the valid regions associated with the API key.
Procedure
- Go to .
- Click Add API Key.
- Configure the API key to use the role with the Run file scan via SDK permission.
- Verify that the API key is associated with the region you plan to use.
- Set an expiry time for the API key and make a record of it for future reference.
Install the SDK
Procedure
- Ensure you have already created the API key.
- Run the following commands in your Node.js application folder to install
the Node.js package.
npm install file-security-sdk
- Continue to authenticating.
Authenticate
Procedure
- Supply the AMaaSHostName and API Key to initiate a new instance of the
AmaasGrpcClient.
import { AmaasGrpcClient } from "file-security-sdk"; - Use a fully qualified domain name (FQDN) with or without a port. Replace
__REGION__with the region of your TrendAI™ Vision One account.const amaasHostName = "antimalware.__REGION__.cloudone.trendmicro.com:443";
- Use the region. Replace
__REGION__with the region of your TrendAI™ Vision One account.const amaasHostName = __REGION__;
- Replace
__YOUR_OWN_VISION_ONE_API_KEY__with your own TrendAI™ Vision One API key.const key = __YOUR_OWN_VISION_ONE_API_KEY__;
- Create a new instance of the
AmaasGrpcClientclass using the key.const scanClient = new AmaasGrpcClient(amaasHostName, key);
Next steps
Refer to the following resources as needed:
