Docs

Environment variables

Every environment variable the JavaScript SDK, Python SDK and CLI read: name, purpose, whether it is required, default, whether it is secret and where it applies.

Updated Oct 17, 2026

The SDKs and the CLI can take their settings from the environment. Explicit arguments always win over environment variables.

SDKs (JavaScript and Python)

VariablePurposeRequiredSecretWhere
SOVARIA_URLThe project URL, https://<project-ref>.sovarias.in.Yes (or one of the two below)NoServers, functions, CI
NEXT_PUBLIC_SOVARIA_URLSame, exposed to Next.js browser code.—NoNext.js
VITE_SOVARIA_URLSame, exposed to Vite browser code.—NoVite apps
SOVARIA_ANON_KEYThe anon key.For client-style useNoAnywhere
VITE_SOVARIA_ANON_KEYThe anon key for Vite browser code (read by createClientFromProjectConfig).—NoVite apps
SOVARIA_PUBLISHABLE_KEYAlias for the anon key.—NoAnywhere
SOVARIA_ACCESS_TOKENA token or server key to call as. Takes precedence over the anon key.For server useYesServers, CI only
SOVARIA_EXPIRES_INSeconds until SOVARIA_ACCESS_TOKEN expires, if it is a session token.NoNoServers
SOVARIA_ORG_ID, SOVARIA_PROJECT_IDPin the organization and project (normally discovered from the URL).NoNoMulti-project tools
SOVARIA_ENV_IDCall an environment other than production.NoNoStaging, previews
import { SovariaSDK } from '@sovaria/sdk'
const sovaria = SovariaSDK.fromEnv(process.env)   // SOVARIA_URL + SOVARIA_ACCESS_TOKEN or SOVARIA_ANON_KEY

CLI

VariablePurposeSecret
SOVARIA_API_KEYA project key to authenticate with in CI (instead of sov login). Wins over stored logins.Yes
SOVARIA_ACCESS_TOKENA token to authenticate with. Wins over SOVARIA_API_KEY and stored logins.Yes
SOVARIA_PASSWORDPassword for non-interactive sov login --email <email>.Yes
SOVARIA_GITHUB_TOKENGitHub token for deploying functions from a repository (otherwise gh auth token is used).Yes
SOV_JSON=1Print raw JSON instead of tables (same as --json).No
SOV_DEBUG=1Show full error traces.No

The CLI also reads sovaria.config.json (written by sov link / sov init) for the current folder's project, and ~/.sovaria/config.yaml for named profiles. Which project: flags first, then sovaria.config.json, then the scope set with sov scope set. Which credentials: SOVARIA_ACCESS_TOKEN, then SOVARIA_API_KEY, then the stored sov login.

Inside functions

Functions read the secrets and variables you bind to them from their environment at run time (Functions). Store values per environment so staging never uses production keys.

Troubleshooting

MessageCause
Missing SOVARIA_URL (or NEXT_PUBLIC_SOVARIA_URL / VITE_SOVARIA_URL)The variable isn't set in the process that runs your code (check your hosting provider's settings and restart).
401 on every requestWrong project's key, a revoked key, or an expired SOVARIA_ACCESS_TOKEN.
Warning: SOVARIA_PUBLISHABLE_KEY looks like a user JWTA session token was put where the anon key belongs; use SOVARIA_ACCESS_TOKEN for tokens.
Browser code shows undefinedBundlers only expose prefixed variables (VITE_, NEXT_PUBLIC_), and only at build time — rebuild after changing them.
Something unclear or missing on this page?Tell us