Required variables
These must be set for your application to function:DEVKIT4AI_MODE
Value:project (always for Starter Kit)
Description: Configures the application as an end-user project mode deployment.
NEXT_PUBLIC_API_URL
Value:https://api.vibecoding.ad (or https://api.devkit4ai.com)
Description: Base URL for the Cloud API. The NEXT_PUBLIC_ prefix makes it available in the browser.
DEVKIT4AI_DEVELOPER_KEY
Value: Your developer key from Cloud Admin (starts withdk_)
Description: Authenticates your application with the Cloud API. Get from Cloud Admin after creating an account.
DEVKIT4AI_PROJECT_ID
Value: Your project UUID from Cloud Admin Description: Identifies which project this deployment belongs to. Must be a valid UUID.DEVKIT4AI_PROJECT_KEY
Value: Your project API key from Cloud Admin (starts withak_)
Description: Scopes API requests to your specific project. Also referred to as “API Key” in the Cloud Admin interface.
API Keys use the
ak_ prefix (not pk_). The environment variable is named DEVKIT4AI_PROJECT_KEY for clarity about its scope.Optional variables
These enhance functionality but aren’t required:ENVIRONMENT
Value:local, development, staging, production
Description: Identifies the deployment environment for logging and debugging.
local
NODE_ENV
Value:development or production
Description: Next.js uses this to enable/disable optimizations. Set automatically by most hosting providers.
development
PORT
Value: Any port number (e.g.,3000, 3004, 8080)
Description: HTTP port for the development/production server.
3004 (development), 3000 (production)
NEXT_PUBLIC_DEMO_MODE
Value:true or false
Description: Enables demo features and development tools in the UI.
false
Usage:
Setting environment variables
Local development
Create.env.local in your project root:
.env.local
.env.local is in .gitignore and won’t be committed to version control.Vercel
- Go to Project Settings → Environment Variables
- Add each variable with appropriate scope:
- Production: Live site
- Preview: PR deployments
- Development: Local development with
vercel dev
- Redeploy for changes to take effect
Netlify
- Go to Site Settings → Build & Deploy → Environment
- Click “Add variable”
- Enter key and value
- Deploy from Build settings or trigger webhook
Docker
Pass via command line:.env file:
Other platforms
Consult your platform’s documentation:- Railway: Environment variables in project settings
- Render: Environment tab in web service settings
- Fly.io:
fly secrets set KEY=value - AWS Amplify: Environment variables in app settings
Accessing variables
Server-side (Server Components, API routes)
Client-side (Client Components)
OnlyNEXT_PUBLIC_* variables are available:
Validation
The Starter Kit validates required variables on startup:lib/deployment-mode.ts
Security best practices
Never commit secrets
Never commit secrets
- Add
.env.localto.gitignore - Use
.env.examplewith placeholder values - Document required variables in README
Rotate credentials regularly
Rotate credentials regularly
- Generate new API keys every 90 days
- Update in hosting provider and Cloud Admin
- Test before revoking old keys
Use environment-specific keys
Use environment-specific keys
- Different keys for dev, staging, production
- Prevents accidental production data access
- Isolates environment security
Minimize NEXT_PUBLIC_ variables
Minimize NEXT_PUBLIC_ variables
- Only make public what client needs
- API keys should stay server-side
- Use Server Actions to proxy sensitive calls

