npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blindfold/sdk

v1.3.0

Published

JavaScript/TypeScript SDK for Blindfold Gateway

Downloads

404

Readme

Blindfold JS SDK

The official JavaScript/TypeScript SDK for Blindfold - The Privacy API for AI.

Securely tokenize, mask, redact, and encrypt sensitive data (PII) before sending it to LLMs or third-party services.

How to use it

1. Install SDK

Javascript/ Typescript

npm install @blindfold/sdk
# or
yarn add @blindfold/sdk
# or
pnpm add @blindfold/sdk

Python SDK

pip install blindfold-sdk

2. Get Blindfold API key

  1. Sign up to Blindfold here.
  2. Sign up to Blindfold here.
  3. Get your API key here.
  4. Set environment variable with your API key
BLINDFOLD_API_KEY=sk-***

Initialization

import { Blindfold } from '@blindfold/sdk';

const client = new Blindfold({
  apiKey: 'your-api-key-here',
  // Optional: Track specific end-user for audit logs
  userId: 'user_123' 
});

Tokenize (Reversible)

Replace sensitive data with reversible tokens (e.g., <Person_1>).

const response = await client.tokenize(
  "Contact John Doe at [email protected]",
  {
    // Optional: Use a pre-configured policy
    policy: 'gdpr_eu',  // or 'hipaa_us', 'basic'
    // Optional: Filter specific entities
    entities: ['person', 'email address'],
    // Optional: Set confidence threshold
    score_threshold: 0.4
  }
);

console.log(response.text);
// "Contact <Person_1> at <Email Address_1>"

console.log(response.mapping);
// { "<Person_1>": "John Doe", "<Email Address_1>": "[email protected]" }

Detokenize

Restore original values from tokens.

⚡ Note: Detokenization is performed client-side for better performance, security, and offline support. No API call is made.

// No await needed - runs locally!
const original = client.detokenize(
  "AI response for <Person_1>",
  response.mapping
);

console.log(original.text);
// "AI response for John Doe"

console.log(original.replacements_made);
// 1

Mask

Partially hide sensitive data (e.g., ****-****-****-1234).

const response = await client.mask(
  "Credit card: 4532-7562-9102-3456",
  {
    masking_char: '*',
    chars_to_show: 4,
    from_end: true
  }
);

console.log(response.text);
// "Credit card: ***************3456"

Redact

Permanently remove sensitive data.

const response = await client.redact(
  "My password is secret123",
  {
    entities: ['person', 'email address']
  }
);

Hash

Replace data with deterministic hashes (useful for analytics/matching).

const response = await client.hash(
  "User ID: 12345",
  {
    hash_type: 'sha256',
    hash_prefix: 'ID_'
  }
);

Synthesize

Replace real data with realistic fake data.

const response = await client.synthesize(
  "John lives in New York",
  {
    language: 'en'
  }
);

console.log(response.text);
// "Michael lives in Boston" (example)

Encrypt

Encrypt sensitive data using AES (reversible with key).

const response = await client.encrypt(
  "Secret message",
  {
    encryption_key: 'your-secure-key-min-16-chars'
  }
);

Batch Processing

Process multiple texts in a single request (max 100 texts):

const result = await client.tokenizeBatch(
  ["Contact John Doe", "[email protected]", "No PII here"],
  { policy: "gdpr_eu" }
);

console.log(result.total);      // 3
console.log(result.succeeded);  // 3
console.log(result.failed);     // 0

result.results.forEach(item => console.log(item.text));

All methods have batch variants: tokenizeBatch, detectBatch, redactBatch, maskBatch, synthesizeBatch, hashBatch, encryptBatch.

Configuration

Entity Types

Common supported entities:

  • person
  • email address
  • phone number
  • credit card number
  • ip address
  • address
  • date of birth
  • organization
  • iban
  • social security number
  • medical condition
  • passport number
  • driver's license number

Error Handling

The SDK throws typed errors:

import { AuthenticationError, APIError, NetworkError } from '@blindfold/sdk';

try {
  await client.tokenize("...");
} catch (error) {
  if (error instanceof AuthenticationError) {
    // Handle invalid API key
  } else if (error instanceof APIError) {
    // Handle API error (e.g. validation)
  } else if (error instanceof NetworkError) {
    // Handle network issues
  }
}