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

convex-secret-manager

v0.2.0

Published

Convex component for encrypted secret vaults and issued API key lifecycle

Readme

convex-secret-manager

Convex component for encrypted secret vaults and issued API key lifecycle.

Combines the roles of gaganref/convex-secret-store and gaganref/convex-api-keys into one package with per-ownerId tenancy. Any Convex app can use it (SaaS orgs, agents, multi-tenant backends).

Two modules

| Module | Use | |--------|-----| | Vault | Store user-supplied credentials (OpenAI, Venice, webhooks) encrypted at rest | | Issued keys | Issue sm_ machine tokens with hash-only storage, refresh, revoke, and audit |

vs gaganref

| | gaganref (2 packages) | convex-secret-manager | |--|----------------------|-------------------------| | Path model | namespace + name | ownerId + namespace + name | | Use case | Generic apps | Multi-tenant backends that issue keys too | | Install | Two components | One component | | Vault crypto | Envelope + KEK rotation | Envelope (defineKeys) + legacy single-key | | Issued validate | Query (side-effect free) | Query | | Sweeps | Hourly crons | Hourly crons (built-in) |

Use gaganref when you need only one concern. Use this package when one owner should hold both third-party credentials and issued machine tokens.

Install

npm install convex-secret-manager
// convex/convex.config.ts
import { defineApp } from "convex/server";
import { v } from "convex/values";
import { defineKeys } from "convex-secret-manager";
import secretManager from "convex-secret-manager/convex.config.js";

const app = defineApp({
  env: {
    MY_APP_KEK_V1: v.string(),
  },
});

app.use(secretManager, {
  env: {
    SECRET_MANAGER_KEYS: defineKeys({
      1: process.env.MY_APP_KEK_V1!,
    }),
  },
});

export default app;
// convex/secrets.ts
import { SecretManager } from "convex-secret-manager";
import { components } from "./_generated/api.js";

export const secretManager = new SecretManager(components.secretManager);

Set on the Convex deployment:

SECRET_MANAGER_KEYS=1:<kek-material>
# or legacy single key:
SECRET_MANAGER_ENCRYPTION_KEY=...

Vault paths

ownerId   = orgId | userId | deployment
namespace = providers | integrations | webhooks
name      = openai.apiKey

Issued keys API (parity highlights)

  • issued.create / validate (query) / touch / revoke / revokeAll
  • issued.refresh — rotate with grace period
  • issued.update / getKey / list (paginated + effectiveStatus)
  • Hourly sweep crons for expired and idle keys
  • cleanupKeys / cleanupEvents internal jobs

Vault API (parity highlights)

  • vault.putPlaintext — component-side envelope encryption with AAD
  • vault.getResult{ ok, value } | { ok: false, reason }
  • vault.update — metadata/TTL without re-encrypt
  • vault.list — paginated with effectiveState
  • auditEvents.listEvents — paginated audit trail
  • vaultRotate.rotate / isRotationComplete — KEK rotation drain
  • vaultCleanup.cleanupSecrets — expired secret cleanup

Example

See example/ for a minimal Convex + Vite dashboard.

License

MIT