@nebius/js-sdk - v0.2.54
    Preparing search index...

    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.

    import { TokenCache } from '@nebius/js-sdk/runtime/token/file_cache/token_cache';

    const cache = new TokenCache({
    cacheFile: '~/.config/my-app/credentials.yaml',
    });
    const token = await cache.get('developer-profile');

    Indexable

    • [key: symbol]: () => unknown

      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.

        • (): unknown
        • Returns a JSON-safe value for logs.

          Returns unknown

    Index
    $type: "nebius.sdk.TokenCache" = 'nebius.sdk.TokenCache'

    Contains the fully qualified runtime type name.

    • 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.

      Parameters

      • name: string
      • token: Token

      Returns Promise<boolean>