Skip to main content
Reads the secrets in a set. This is equivalent to dotenv, but without a file.
import { client } from "@elding/sdk";

const elding = await client();
const key = elding.secret("OPENAI_API_KEY");   // throws when missing
const opt = elding.secretOrUndefined("MAYBE"); // undefined when missing
The SDK automatically reads the set ID from .elding.json and the token from your operating system’s credential store. This is useful for loading several non-HTTP secrets, such as configuration and database credentials, at once.
In client() mode, real values are loaded into your application’s memory. For an HTTP API key that must never enter the application, use configure().