Injected variables
Every GIGADRIVE_ variable the platform sets inside a deployed Function, and when each one is present.
Gigadrive Network sets these variables inside every Function it starts, on top of the environment variables you configured yourself. They are the whole of the zero-config surface: the SDK reads four of them, and your code can read any of them.
| Variable | Value | Present |
|---|---|---|
GIGADRIVE_CLIENT_ID | Client id of the Function's credential, a UUID | Always |
GIGADRIVE_CLIENT_SECRET | Client secret, a gdnet_secret_ string, marked sensitive | Always |
GIGADRIVE_APPLICATION_ID | UUID of the application this deployment belongs to | Always |
GIGADRIVE_DEPLOYMENT_ID | UUID of the deployment serving this Function | Always |
GIGADRIVE_URL | https:// plus the deployment's hostname | Always, and it replaces any GIGADRIVE_URL you set yourself |
GIGADRIVE_API_BASE_URL | Base URL of the Gigadrive Network API | In production |
GIGADRIVE_API_URL | The same value as GIGADRIVE_API_BASE_URL | In production, always alongside GIGADRIVE_API_BASE_URL |
GIGADRIVE_CLIENT_SECRET is a live credential
It authenticates as your application against the Gigadrive Network API. Keep it server side: do not log it, do not return it from a handler, and do not let a bundler inline it into client-side code.
What the SDK reads
GIGADRIVE_CLIENT_ID and GIGADRIVE_CLIENT_SECRET become the client credentials. GIGADRIVE_APPLICATION_ID becomes the default application context, which is why client.storage calls do not need an application argument inside a Function. GIGADRIVE_API_BASE_URL sets the API host.
GIGADRIVE_URL and GIGADRIVE_DEPLOYMENT_ID exist for your code. The SDK never reads them.
// Absolute URL of this deployment, for a callback a third party has to reach.
// The variable is absent on your own machine, hence the local fallback.
const baseUrl = process.env.GIGADRIVE_URL ?? 'http://localhost:3000';
const returnUrl = new URL('/checkout/complete', baseUrl).toString();Variables you can set yourself
The SDK also reads these when they are present, and none of them is injected. Set them on the application the way you set any other value, as described in Environment variables, when you want a Function to authenticate as something other than itself.
| Variable | Effect |
|---|---|
GIGADRIVE_BEARER_TOKEN | Uses this token as it is and never refreshes it |
GIGADRIVE_REFRESH_TOKEN | Refresh-token flow against the identity provider, paired with GIGADRIVE_CLIENT_ID |
GIGADRIVE_IDP_ISSUER_URL | Overrides the identity provider issuer, which defaults to https://idp.gigadrive.de |
GIGADRIVE_API_BASE_URL | Overrides the API host, injected in production but yours to change |
Resolution order matters. Options passed to new GigadriveClient({ ... }) beat the environment, and inside the environment a bearer token beats client credentials. Setting GIGADRIVE_BEARER_TOKEN on an application therefore takes its Functions off their own identity, which is rarely what you want.
None of the injected variables exist on your own machine. To get a working pair locally, run gigadrive env pull --with-credentials, described in Using the SDK.
