Bindings overview
Workflows
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}
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.
export const workflowSettings = { // ...other settings bindings: {"kinde.env": {}}};
The Kinde infrastructure library provides type-safe environment variable access:
import {getEnvironmentVariable} from "@kinde/infrastructure";
const myVar = getEnvironmentVariable("MY_VAR")?.value;
If you’re not using the infrastructure library, you can call the underlying API directly:
kinde.env.getEnvironmentVariable("MY_VAR")?.value;