1.0.6 • Published 6 months ago
securelog-sdk v1.0.6
SecureLog SDK Documentation
Overview
The SecureLog SDK provides functionalities to interact with the SecureLog API for secret detection and redaction. It includes classes and methods to configure the client, detect secrets in text, and redact secrets from text.
Installation
To install the SecureLog SDK, use the following command:
npm install securelog-sdk
Usage
Importing the SDK To use the SecureLog SDK, import the Securelog class:
import Securelog from 'securelog-sdk';
Initializing the Client
Create an instance of the Securelog class by passing the necessary configuration:
const securelog = new Securelog({
apiKey: 'YOUR_API_KEY',
url: 'https://api.securelog.com', // Optional
headers: {
'Custom-Header': 'value'
},
customDetectors: [
{
regex: 'your-regex',
keywords: ['keyword1', 'keyword2'],
detectorType: 'custom',
},
],
});
Redacting Secrets
To redact secrets from a text, use the redactSecrets method:
const redacted = await securelog.redactSecrets({
text: 'your text here',
maskedValue: '****',
visibleChars: 4,
customDetectors: [
{
regex: 'your-regex',
keywords: ['keyword1', 'keyword2'],
detectorType: 'custom',
},
],
});
console.log(redacted);