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

@kindgi/env-schema

v0.8.1

Published

Machine-readable registry of the Kindgi runtime's operator-facing env vars. Single source of truth for boot-time validation (validateEnvForTarget), .env.example scaffolding (renderEnvExample), and tools or coding agents introspecting deployment config. Ad

Readme

@kindgi/env-schema

Machine-readable registry of the Kindgi runtime's operator-facing env vars. Single source of truth for:

  • Boot-time validation — validateEnvForTarget reports the required vars a deployment target is missing.
  • .env.example scaffolding — renderEnvExample renders KINDGI_ENV_SCHEMA (or a filtered part of it) as an .env.example body.
  • Tools and coding agents — import { KINDGI_ENV_SCHEMA } to introspect deployment-config surface without parsing source.

Adding a new env var

Append one entry to KINDGI_ENV_SCHEMA in packages/env-schema/src/schema.ts. A KINDGI_* var that is not declared there is invisible to envVarsForTarget, validateEnvForTarget and renderEnvExample.

{
  name: 'KINDGI_MY_NEW_VAR',
  description: 'One-line human-readable explanation.',
  example: 'realistic-placeholder',
  required: true,   // false = optional (default applies)
  appliesTo: (t) => t.secretsBackend === 'postgres',
  group: 'secrets',
  allowedValues: ['a', 'b', 'c'], // optional enum hint
},

Targets

An EnvTarget narrows the vars to one deployment's choices. Every field is optional:

  • component: which process reads the env, the Kindgi server (the default) or the pack-service, the separate process that runs a pack's code (its tools and guardrail checks). The pack service's target lists KINDGI_PACK_SERVICE_TOKEN, KINDGI_PACK_INDEX, KINDGI_PACK_SERVICE_MAX_CONCURRENCY, KINDGI_PACK_ENV_CHECK, KINDGI_PACK_ENV_FILTER, KINDGI_PACK_ENV_DECLARED and KINDGI_PACK_TENANT_ID (the one tenant it serves, when set), and none of the server's vars. It also listens on PORT (default 8080), the platform convention, which isn't a Kindgi variable.
  • secretsBackend, secretsBackendKms: the server's secrets backend and its KMS vendor.
  • packTransport: http when the server calls a pack service at KINDGI_PACK_SERVICE_URL. Its token (KINDGI_PACK_SERVICE_TOKEN, shared with the pack service) is then required, and KINDGI_PACK_CALL_TIMEOUT_MS and KINDGI_PACK_SERVICE_AUTH apply. The server's KINDGI_PACK_ROUTING (single by default, or per-deployment, which needs KINDGI_PACK_ENDPOINT_HOSTS, and KINDGI_PACK_ENDPOINT_KMS_KEY unless the secrets backend is postgres) picks the pack service for each call; their parsers (parsePackRouting, parsePackEndpointHosts, packEndpointHostAllowed, parsePackEndpointKmsKey, parsePackTenantId) are exported, so the server and the pack service read them the same way.

What lives here

  • KINDGI_* (operator-facing) → declared here. Anything an operator sets in their Docker Compose / K8s ConfigMap / .env file.
  • Internal opt-in switches that are not deployment config are not declared here.

API

import {
  KINDGI_ENV_SCHEMA,
  envVarsForTarget,
  renderEnvExample,
  validateEnvForTarget,
  type EnvTarget,
  type EnvVarSpec,
} from '@kindgi/env-schema';

// Filter to just vars that apply to a target.
const target: EnvTarget = { secretsBackend: 'postgres', secretsBackendKms: 'gcp' };
const vars = envVarsForTarget(target);

// Render as .env.example body.
const body = renderEnvExample(vars);
writeFileSync('.env.example', body);

// Validate a resolved env at boot.
const result = validateEnvForTarget(process.env, target);
if (!result.ok) {
  throw new Error(`Missing required env vars: ${result.missing.join(', ')}`);
}

Dependencies

Apache 2.0. Its one dependency is @kindgi/types (for the shared UUID check), which has none, so tooling and the runtime can both consume it.