Skip to content
  • Workflows
  • Bindings

kinde.env

The kinde.env binding lets you access environment variables in your workflows that you have previously set up in the Kinde admin area or via the management API.

getEnvironmentVariable(key: string): {value: string, isSecret: boolean}

Link to this section

Get the value of an environment variable. The value is returned as an object with two properties: value (the value of the variable) and isSecret (a boolean indicating whether the variable is a secret).

Secret variables will be redacted in the logs.

Available in workflows

Link to this section
export const workflowSettings = {
// ...other settings
bindings: {"kinde.env": {}}
};
Link to this section

The Kinde infrastructure library provides type-safe environment variable access:

import {getEnvironmentVariable} from "@kinde/infrastructure";
const myVar = getEnvironmentVariable("MY_VAR")?.value;

Using the low-level API

Link to this section

If you’re not using the infrastructure library, you can call the underlying API directly:

kinde.env.getEnvironmentVariable("MY_VAR")?.value;