@bstockwelldev/env-kit
v0.1.0
Published
Zod env schemas and validation utilities for @bstockwelldev SaaS apps
Maintainers
Readme
@bstockwelldev/env-kit
Zod schemas and validation helpers extracted from tabletop-studio and codex-apps SaaS templates.
Install
Public scoped package on npm. No registry auth required to install.
pnpm add @bstockwelldev/env-kitPublishing (maintainers only): set NPM_TOKEN and use repo .npmrc — see codex-apps/.npmrc.example (same pattern as @bstockwelldev/prompt-rubric).
Local sibling development (polyrepo layout):
{
"dependencies": {
"@bstockwelldev/env-kit": "file:../codex-apps/packages/env-kit"
}
}pnpm override (semver in dependencies, local link at install time):
{
"dependencies": {
"@bstockwelldev/env-kit": "^0.1.0"
},
"pnpm": {
"overrides": {
"@bstockwelldev/env-kit": "file:../codex-apps/packages/env-kit"
}
}
}Usage
import {
validateEnv,
supabaseNextEnvSchema,
SupabaseEnvError,
requireEnv,
} from '@bstockwelldev/env-kit';
// Runtime validation (throws EnvValidationError)
const env = validateEnv(supabaseNextEnvSchema);
// CLI scripts
requireEnv({
STRIPE_SECRET_KEY: 'Stripe dashboard → API keys',
});
// Partial groups
import { envGroups, mergeEnvGroups } from '@bstockwelldev/env-kit';
const schema = mergeEnvGroups('core', 'auth');Exports
| Export | Purpose |
| ------ | ------- |
| validateEnv, safeParseEnv, getEnvVar | Zod-backed validation |
| EnvValidationError, SupabaseEnvError | Typed config failures |
| requireEnv | CLI exit-on-missing helper |
| envGroups, mergeEnvGroups | Feature-scoped schemas |
| supabaseNextEnvSchema | tabletop-studio / Next public URL pattern |
| supabaseTemplateEnvSchema | codex-apps template pattern |
Related packages
@bstockwelldev/supabase-kit— Supabase client factories; depends on env-kit schemas@bstockwelldev/auth-next(planned) — NextAuth options factory
See docs/P0_EXTRACTION.md for the full P0 roadmap.
