Skip to content

@saflib/secret-store


@saflib/secret-store

Classes

ClassDescription
EnvSecretNotFoundErrorReturned when process.env[name] is missing or blank.
EnvSecretStoreResolves secrets from process.env by variable name.
SecretNotDeclaredErrorReturned when getSecretByName is called for a name not in the package secrets.json.
SecretStore-

Type Aliases

Type AliasDescription
CreateSecretStoreOptions-
SecretManifestPackage-local list of secrets this package may fetch.
SecretManifestEntryOne declared secret for a package's secrets.json.
SecretStoreErrorUnion of errors returned by SecretStore#getSecretByName. Vendor backends may return additional Error subclasses.

Functions

FunctionDescription
createSecretStoreCreates an env-backed SecretStore. For Infisical, use @saflib/vendors-infisical.
getSecretStoreReturns the store set by setSecretStore.
hasSecretStoreWhether a process-level store has been set.
isSecretDeclaredReturns true when name appears in the package secrets manifest.
resetSecretStoreForTestsTest-only: clear the process-level store so configure / set can run again.
setSecretStoreSets the process-level secret store. Idempotent — subsequent calls are no-ops. Vendor packages (e.g. @saflib/vendors-infisical) call this from their configure helpers.