Node.js Client for DLP API (Alpha)
DLP API: The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.
Quick Start
In order to use this library, you first need to go through the following steps:
- Select or create a Cloud Platform project.
- Enable the DLP API.
- Setup Authentication.
Installation
$ npm install --save @google-cloud/dlp
Preview
DlpServiceClient
var dlp = require('@google-cloud/dlp');
var client = dlp({
});
var minLikelihood = dlp.v2beta1.types.Likelihood.POSSIBLE;
var inspectConfig = {
minLikelihood : minLikelihood
};
var type = 'text/plain';
var value = 'my phone number is 215-512-1212';
var itemsElement = {
type : type,
value : value
};
var items = [itemsElement];
var request = {
inspectConfig: inspectConfig,
items: items
};
client.inspectContent(request).then(function(responses) {
var response = responses[0];
})
.catch(function(err) {
console.error(err);
});
Next Steps