Skip to main content

SecRefs

secRefs is a ready-made singleton using the default providers. Construct your own when you need custom aliases.

Errors

A failed fetch throws SecretFetchError, which classifies the cause:
kind is what lets a caller retry a transient fault without also retrying a dead credential forever. Expanding a map throws SecRefsResolutionError, aggregating every failure. Its isAuthOnly getter distinguishes “your credentials lapsed” from “your references are wrong”.

Providers

Each takes options documented on its own page. All accept cacheTtlMs and staleGraceMs — see Load time vs use time.

Custom providers

Implement ISecretProvider (or extend BaseSecretProvider, which gives you concurrent batching for free) and register it under any alias: