SecRefs
secRefs is a ready-made singleton using the default providers. Construct your
own when you need custom aliases.
Errors
A failed fetch throwsSecretFetchError, 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
cacheTtlMs and
staleGraceMs — see Load time vs use time.
Custom providers
ImplementISecretProvider (or extend BaseSecretProvider, which gives you
concurrent batching for free) and register it under any alias: