Zum Inhalt springen
GigadriveDocs

System variables

The variables Gigadrive Network sets in your build and in every Function, plus the name prefixes it keeps for itself.

Gigadrive Network sets a handful of variables itself, on top of the ones you configure. They are applied after yours, so any name in the following tables holds the platform's value inside a Function no matter what you stored.

In a running Function

VariableValuePresent
GIGADRIVE_APPLICATION_IDThe application's UUIDEvery Function
GIGADRIVE_DEPLOYMENT_IDThe deployment's UUIDEvery Function
GIGADRIVE_URLhttps:// plus the deployment's own hostnameEvery Function
GIGADRIVE_CLIENT_IDClient id of this deployment's workload identityEvery Function
GIGADRIVE_CLIENT_SECRETClient secret of the same identityEvery Function
GIGADRIVE_API_BASE_URLBase URL of the Gigadrive Network APIWhen the platform has an API base URL configured
GIGADRIVE_API_URLThe same value as GIGADRIVE_API_BASE_URLAlongside GIGADRIVE_API_BASE_URL

GIGADRIVE_URL names the immutable per-deployment hostname, not your production URL, so a preview deployment and a production deployment each see their own address. Use it to build absolute callback URLs that keep pointing at the deployment that issued them.

GIGADRIVE_CLIENT_ID and GIGADRIVE_CLIENT_SECRET are an OAuth client the platform mints for this deployment. @gigadrive/sdk reads both with no configuration, so new GigadriveClient() inside a Function authenticates as that deployment against a narrow set of scopes. OIDC federation covers what it can and cannot reach. Treat the secret like any other credential and keep it out of logs and client bundles.

In a build

VariableValueYours can replace it
PROJECT_DIRECTORYAbsolute path of your project in the build sandboxYes
VERCEL1Yes
NITRO_PRESETnode-serverYes
CItrueYes
NPM_CONFIG_YEStrueYes
npm_config_cache, npm_config_store_dir, YARN_CACHE_FOLDER, BUN_INSTALL_CACHE_DIRPackage manager cache directories on the build cache volumeYes
GIGADRIVE_DEPLOYMENT_IDThe deployment's UUIDNo

VERCEL is set because a long tail of ecosystem packages branch on it. NITRO_PRESET is pinned so a Nitro or Nuxt build keeps writing to .output rather than switching to a hosted-platform layout.

Your variables are applied between the two halves of that table, which is why the last row cannot be replaced. The reserved prefix means you could not have set it in the first place.

Reserved prefixes

You cannot store a variable whose name starts with GIGADRIVE_, GD_, NEBULA_ or __. The check upper-cases the name first, so gigadrive_token is rejected too, with Environment variable key cannot start with reserved prefix "GIGADRIVE_".

The console applies the same check while parsing an imported .env file, so a template that ships a reserved name is flagged on the offending line before you submit anything.