Output Formats
Hush can output secrets in multiple formats to match what each package in your monorepo expects.
Available Formats
| Format | Output File | Use Case |
|---|---|---|
dotenv | .env.development / .env.production | Next.js, Vite, Expo, Remix, Node.js, etc. |
wrangler | .dev.vars | Cloudflare Workers & Pages |
json | .env.development.json | AWS Lambda, serverless, JSON configs |
shell | .env.development.sh | CI/CD pipelines, Docker builds |
yaml | .env.development.yaml | Kubernetes ConfigMaps, Docker Compose |
dotenv
Standard .env file format. The most common choice for Node.js applications.
Configuration
targets: - name: app path: ./packages/app format: dotenvOutput
File: .env.development
DATABASE_URL=postgres://localhost/mydbAPI_KEY=sk_test_xxxDEBUG=trueFile: .env.production
DATABASE_URL=postgres://prod-host/mydbAPI_KEY=sk_live_xxxDEBUG=falseCompatibility
Works with every major framework:
| Framework | Client Prefix |
|---|---|
| Next.js | NEXT_PUBLIC_* |
| Vite | VITE_* |
| Create React App | REACT_APP_* |
| Vue CLI | VUE_APP_* |
| Nuxt | NUXT_PUBLIC_* |
| Astro | PUBLIC_* |
| SvelteKit | PUBLIC_* |
| Expo | EXPO_PUBLIC_* |
| Gatsby | GATSBY_* |
| Remix | (server-only) |
| Node.js | (any) |
wrangler
Cloudflare Wrangler format for Workers development.
Configuration
targets: - name: api path: ./packages/api format: wranglerOutput
File: .dev.vars
DATABASE_URL=postgres://localhost/mydbSTRIPE_SECRET_KEY=sk_test_xxxJWT_SECRET=super-secret-keyUsage with Wrangler
# Local development reads from .dev.vars automaticallywrangler dev
# Production uses secrets set via wrangler secrethush push # Pushes secrets to CloudflarePush to Production
Hush can push secrets to Cloudflare Workers:
# Preview what would be pushedhush push --dry-run
# Push production secretshush pushThis runs wrangler secret put for each variable.
json
JSON object format for applications that consume JSON configuration.
Configuration
targets: - name: shared path: ./packages/shared format: jsonOutput
File: .env.development.json
{ "DATABASE_URL": "postgres://localhost/mydb", "API_KEY": "sk_test_xxx", "DEBUG": "true"}File: .env.production.json
{ "DATABASE_URL": "postgres://prod-host/mydb", "API_KEY": "sk_live_xxx", "DEBUG": "false"}Use Cases
- Configuration files that need JSON
- Tools that read JSON config
- API responses or fixtures
- Type-safe config loading
shell
Sourceable shell script with export statements.
Configuration
targets: - name: scripts path: ./scripts format: shellOutput
File: .env.development.sh
#!/bin/shexport DATABASE_URL="postgres://localhost/mydb"export API_KEY="sk_test_xxx"export DEBUG="true"File: .env.production.sh
#!/bin/shexport DATABASE_URL="postgres://prod-host/mydb"export API_KEY="sk_live_xxx"export DEBUG="false"Usage
# Source the file to set environment variablessource .env.development.sh
# Or in a script#!/bin/bashsource ./scripts/.env.production.sh./deploy.shUse Cases
- CI/CD pipelines
- Shell scripts
- Docker build arguments
- Makefile targets
yaml
YAML format for Kubernetes ConfigMaps, Docker Compose, and other YAML-based configuration.
Configuration
targets: - name: k8s path: ./k8s format: yamlOutput
File: .env.development.yaml
DATABASE_URL: "postgres://localhost/mydb"API_KEY: "sk_test_xxx"DEBUG: "true"REDIS_URL: "redis://localhost:6379"File: .env.production.yaml
DATABASE_URL: "postgres://prod-host/mydb"API_KEY: "sk_live_xxx"DEBUG: "false"REDIS_URL: "redis://prod-redis:6379"Use Cases
- Kubernetes ConfigMaps and Secrets
- Docker Compose environment files
- Helm chart values
- Any YAML-based configuration
Creating a Kubernetes ConfigMap
# Generate the YAMLhush decrypt -e production
# Create ConfigMap from the generated filekubectl create configmap my-app-config --from-file=k8s/.env.production.yaml
# Or use the file directly in your manifestsDocker Compose Integration
services: app: env_file: - ./config/.env.development.yamlChoosing a Format
| Your Stack | Recommended Format |
|---|---|
| Next.js, Vite, CRA, Vue, Nuxt | dotenv |
| Astro, SvelteKit, Remix | dotenv |
| Expo / React Native | dotenv |
| Gatsby | dotenv |
| Cloudflare Workers & Pages | wrangler |
| AWS Lambda, serverless | json |
| Kubernetes, Docker Compose | yaml |
| CI/CD pipelines, shell scripts | shell |
| Node.js / general backend | dotenv |
Multiple Formats
You can use different formats for different targets:
targets: # Next.js app uses dotenv - name: web path: ./apps/web format: dotenv include: - NEXT_PUBLIC_*
# Cloudflare Worker uses wrangler - name: api path: ./apps/api format: wrangler exclude: - NEXT_PUBLIC_*
# Lambda functions use JSON - name: lambda path: ./packages/lambda format: json
# Kubernetes uses YAML - name: k8s path: ./k8s format: yaml exclude: - NEXT_PUBLIC_*
# CI scripts use shell - name: ci path: ./scripts format: shell