Environment Variables in JStack
JStack supports multiple deployment targets such as Cloudflare Workers, Vercel, Netlify, and more. This guide will help you set up environment variables correctly based on your deployment platform.
JStack supports full environment variable type-safety:
server/jstack.ts
Node.js (Vercel, Netlify, etc.)
If you deploy JStack in a Node.js environment (e.g., Vercel, Netlify), both the frontend and the backend will run on Node.js. You can access environment variables anywhere using process.env
.
-
Local development
.env
-
Accessing variables
Cloudflare Workers
When using Cloudflare Workers (either locally with wrangler dev
or in production), you'll need to use Cloudflare's environment variable system:
-
Local development
.dev.vars
-
Accessing variables