Skip to content

Commit 6816bf7

Browse files
committed
docs: add Vite Gemini + OCR env vars
1 parent 5ef4276 commit 6816bf7

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

docs/ENVIRONMENT_VARIABLES.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,21 @@ These are bundled into the client code and exposed to the browser:
3434
- `VITE_STACK_PROJECT_ID` - Stack Auth project ID
3535
- `VITE_STACK_PUBLISHABLE_CLIENT_KEY` - Stack Auth public key
3636
- `VITE_API_URL` - API base URL (empty for production, http://localhost:3000 for dev)
37+
- `VITE_GEMINI_API_KEY` - **Required**; Gemini API key used for Gemini integration and bundled into client code (e.g. `AIza...`)
38+
- `VITE_OCR_ENDPOINT` - **Optional**; custom OCR backend endpoint URL (default: use the app's built-in OCR flow/config if unset; e.g. `http://localhost:3000/api/ocr`)
3739

3840
### Backend (Vercel Functions) - Server-side only
41+
3942
These are only accessible on the server:
4043
- `STACK_PROJECT_ID` - Stack Auth project ID (server-side)
4144
- `STACK_SECRET_SERVER_KEY` - Stack Auth secret key (**NEVER expose to client**)
42-
- `JWT_SECRET` - Secret for signing JWT tokens
45+
- `JWT_SECRET` - Secret for signing JWT tokens (required; API/server will fail fast if missing)
46+
- `JWT_EXPIRES_IN_SECONDS` - Optional; JWT lifetime in seconds (default 86400 / 24h)
47+
- `ALLOWED_ORIGINS` - Comma-separated allowlist for CORS (e.g. `https://your-app.vercel.app,http://localhost:5173`)
48+
- `CORS_ALLOW_CREDENTIALS` - Set to `true` only if you need to send cookies with cross-origin requests
4349
- `DATABASE_URL` - PostgreSQL connection string
4450
- All `POSTGRES_*` and `PG*` variables from Neon
51+
- `GEMINI_API_KEY` - **MUST be server-side only** (no `VITE_` prefix); Gemini API key for AI features (e.g., spreadsheet parsing). **NEVER expose to client code**. All Gemini API calls must be routed through server endpoints (e.g., `/api/parse-spreadsheet`) - the browser should never have direct access to this key.
4552

4653
## Common Issues
4754

@@ -76,6 +83,8 @@ If you get 401 Unauthorized errors when logged in with OAuth:
7683

7784
3. Never commit `.env`, `.env.development`, or `.env.production` files - they're gitignored for security.
7885

86+
4. For the local Express server (`server/server.js`), create `server/.env` (or `.env.local`) with `JWT_SECRET` and `ALLOWED_ORIGINS` that match your dev URLs. See `server/.env.example` for defaults.
87+
7988
## Production Deployment
8089

8190
Environment variables for production are managed in Vercel:

0 commit comments

Comments
 (0)