Stores named access tokens in a process-safe YAML file.
Operations use POSIX file locks, so cooperating SDK processes can share the file without overwriting each other. Expired tokens are not returned and are removed on the next write. The file contains unmasked credentials and must be protected.
Returns a JSON-safe value for logs.
Creates a cache. A new file uses owner-only mode (0o600) by default.
Optionaloptions: TokenCacheOptionsReadonly$typeContains the fully qualified runtime type name.
Returns a JSON-safe value for logs.
Returns a named, unexpired token, or undefined when it is absent or expired.
Removes a named token. Missing files and entries are accepted.
Removes a named token only when both its value and expiration match.
This compare-and-remove operation avoids deleting a newer token written by another process.
Stores or replaces a named token while preserving other entries.
Stores named access tokens in a process-safe YAML file.
Operations use POSIX file locks, so cooperating SDK processes can share the file without overwriting each other. Expired tokens are not returned and are removed on the next write. The file contains unmasked credentials and must be protected.
Example