1.0.6 • Published 6 months ago

securelog-sdk v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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);
1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago