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

edge-secrets-manager-client

v1.1.3

Published

A lightweight TypeScript package for securely managing sensitive secrets with built-in protection against accidental exposure. The SecretsManagerClient class interacts with a secrets API, while the SecureSecret class handles individual secrets safely. Fe

Readme

Secrets Manager Client

A lightweight TypeScript package for securely managing sensitive secrets with built-in protection against accidental exposure. The SecretsManagerClient class interacts with a secrets API, while the SecureSecret class handles individual secrets safely. Features

Secure Secret Handling:

Automatically clears secrets from memory after use to prevent leaks. Automatic Masking: Masks all console outputs to avoid exposing secrets. Type-Safe: Full TypeScript support for reliable development. API Integration: Securely retrieves secrets with support for async/sync operations. Robust Error Handling: Clear error messages for API failures and invalid inputs. Hashing Support: Compute SHA-256 hashes of secrets securely. Tenant-Based API Access: Constructs API URLs using tenant as a subdomain (e.g., https://tenant.wrapup.live/).

License

This project is licensed under the MIT License. See the LICENSE file for details. Installation Install the package via npm: npm install secrets-manager-client

Prerequisites

Axios: Required for HTTP requests. JavaScript Runtime: Must support crypto.subtle (e.g., Node.js or modern browsers).

Getting Started

Initialize the Client Create a SecretsManagerClient instance by providing the tenant and optionally the base domain and protocol (defaults to localhost:3000 and http): import { SecretsManagerClient } from 'secrets-manager-client';

const client = new SecretsManagerClient('my-tenant');

Retrieve and Use a Secret

Use the useSecret method to securely retrieve and process a secret. The tenant is passed during client initialization and included in the API request body: await client.useSecret('secret-id', 'secret-key', async (secureSecret) => { const secretValue = secureSecret.getValue(); console.log('Using secret:', secureSecret.getMaskedValue()); // Outputs: *************** // Perform operations with secretValue });

Execute Callbacks with Secrets

Run asynchronous or synchronous callbacks with secrets: // Asynchronous callback const result = await client.executeWithSecret('secret-id', 'secret-key', async (secret) => { return Processed: ${secret}; }); console.log(result); // Masked output: Processed: ***************

// Synchronous callback const syncResult = await client.executeWithSecretSync('secret-id', 'secret-key', (secret) => { return Processed: ${secret}; }); console.log(syncResult); // Masked output: Processed: ***************

Log Secret Structure

Safely log a secret's structure without exposing its value: await client.logSecretStructure('secret-id', 'secret-key'); // Output: Secret Structure (masked): ***************

Make API Calls with Secrets

Send a secret to an API endpoint securely: const secret = new SecureSecret('my-secret-value'); const response = await secret.useInApiCall('https://api-endpoint.com', { Authorization: 'Bearer token' }); console.log('API response:', response); // Masked output

Security Features

Automatic Secret Clearing: Secrets are wiped from memory after use. Console Output Masking: Prevents accidental secret exposure in logs. Secure API Communication: Uses tenant-based subdomains (e.g., https://tenant.wrapup.live/), includes X-Protect: no-debug header, and enforces a 5-second timeout. Type Checking: Ensures secrets are valid strings or objects with a value property.

Error Handling

The package provides clear error messages for:

Invalid inputs (e.g., missing id, secretKey, or tenant). API request failures (e.g., timeouts, invalid responses). Unavailable secrets (e.g., already consumed or cleared).

Example:

try { const client = new SecretsManagerClient('my-tenant'); await client.useSecret('', 'secret-key', async () => {}); } catch (error) { console.error(error.message); // Output: Invalid id or secretKey provided }