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 🙏

© 2025 – Pkg Stats / Ryan Hefner

envbee-sdk

v1.8.2

Published

NodeJS SDK to use envbee

Downloads

22

Readme

envbee NodeJS SDK

This NodeJS SDK is a client for interacting with the envbee API (see https://envbee.dev). It provides methods to retrieve variables and manage caching for improved performance.

Table of Contents

Installation

Install the SDK using npm:

npm install --save envbee-sdk

Usage

To use the SDK, initialize it with your API key and secret (either via parameters or environment variables):

const envbeeInit = require('envbee-sdk');

const envbee = envbeeInit({
  key: 'YOUR_ENVBEE_API_KEY',
  secret: 'YOUR_ENVBEE_API_SECRET',
  // Optional: encryption key as a 32-byte Buffer or a string
  encKey: Buffer.from('your-32-byte-encryption-key-here', 'utf-8')
});

// Retrieve a variable
const value = await envbee.get('YOUR_ENVIRONMENT_VARIABLE_NAME');

// Retrieve all variables
const allVariables = await envbee.getAllVariables();

Environment Variables

You can configure the SDK using environment variables instead of passing parameters explicitly:

  • ENVBEE_API_KEY: your API key (required if key is not passed)
  • ENVBEE_API_SECRET: your API secret (required if secret is not passed)
  • ENVBEE_ENC_KEY: optional encryption key for decrypting encrypted variables

Example using environment variables:

export ENVBEE_API_KEY="your_api_key"
export ENVBEE_API_SECRET="your_api_secret"
export ENVBEE_ENC_KEY="32-byte-encryption-key-goes-here"

Then initialize the client with no parameters:

const envbeeInit = require('envbee-sdk');

const envbee = envbeeInit();

const value = await envbee.get('YOUR_ENVIRONMENT_VARIABLE_NAME');

If both parameters and environment variables are set, parameters take precedence.

Methods

  • get(variableName): fetch a variable value.
  • getVariables(offset, limit): fetch multiple variable definitions with pagination.

Encryption

Some environment variables in envbee may be encrypted using AES-256-GCM. This SDK supports automatic decryption if you provide the correct encryption key (encKey) during initialization.

  • Encrypted values from the API are prefixed with envbee:enc:v1:.
  • If a variable is encrypted and no or incorrect key is provided, decryption will fail.
  • Decryption is done locally; the encryption key is never sent to the API.

Example of providing the encryption key:

const encKey = Buffer.from('32-byte-long-encryption-key-goes-here', 'utf-8');

const envbee = envbeeInit({
  key: 'YOUR_ENVBEE_API_KEY',
  secret: 'YOUR_ENVBEE_API_SECRET',
  encKey
});

Logging

The SDK includes built-in logging with adjustable log levels. You can set the log level dynamically:

// Set log level to 'warn' to reduce verbosity
envbee.setLogLevel('warn');

Supported levels are: fatal, error, warn, info, debug, and trace.

Caching

The SDK caches variables locally to provide fallback data when offline or the API is unreachable. The cache is updated after each successful API call. Local cache stores variables as received from the API, encrypted or plain.

  • Encryption key is never stored in cache or sent to API.
  • All encryption/decryption happens locally with AES-256-GCM.

API Documentation

For more information on envbee API endpoints and usage, visit the official API documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.