secretKey(value: string | undefined | null): EndstateSecretKey
Example
const endstate = new EndstateClient({
apiKey: secretKey(process.env.ENDSTATE_API_KEY),
});
Narrows an environment value to a secret key. process.env.X is string | undefined, and the client wants the end_sk_ prefix proved, so this is the bridge: it turns a missing or wrong-prefixed key into a startup failure that names the problem, instead of a 401 on the first call.