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

    Provides cached, renewable credentials for an interactive federation account.

    On the first login, the bearer opens a browser unless noBrowserOpen is true. It writes the authorization URL with writer, waits for the local callback, and stores the access token in the shared credentials file. Later processes can reuse the cached token for the same profile.

    This flow is intended for people at a workstation. Use a service account or workload federation for unattended applications.

    import { SDK } from '@nebius/js-sdk';
    import { FederationAccountBearer } from '@nebius/js-sdk/runtime/token/federation_account';

    const credentials = new FederationAccountBearer(
    'developer',
    'client-id',
    'https://auth.example',
    'federation-id',
    );
    const sdk = new SDK({
    credentials,
    userAgentPrefix: 'example-application/1.0',
    });

    Hierarchy (View Summary)

    • Bearer
      • FederationAccountBearer

    Indexable

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

      Provides cached, renewable credentials for an interactive federation account.

      On the first login, the bearer opens a browser unless noBrowserOpen is true. It writes the authorization URL with writer, waits for the local callback, and stores the access token in the shared credentials file. Later processes can reuse the cached token for the same profile.

      This flow is intended for people at a workstation. Use a service account or workload federation for unattended applications.

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

          Returns unknown

    Index
    • Creates an interactive federation flow for profileName.

      timeoutMs limits the wait for the browser callback. It does not limit the following token HTTP request. cacheFilePath selects the shared token cache. Close the SDK to stop renewal timers.

      Parameters

      • profileName: string
      • clientId: string
      • federationEndpoint: string
      • federationId: string
      • Optionalopts: {
            ca?: string | string[] | Buffer<ArrayBufferLike>;
            cacheFilePath?: string;
            fileCacheThrottleMs?: number;
            initialRetryTimeoutMs?: number;
            initialSafetyMarginMs?: number | null;
            lifetimeSafeFraction?: number;
            logger?: Logger;
            maxRetries?: number;
            maxRetryTimeoutMs?: number;
            metrics?: AuthMetricsInput;
            noBrowserOpen?: boolean;
            retrySafetyMarginMs?: number;
            retryTimeoutExponent?: number;
            timeoutMs?: number;
            writer?: (s: string) => void;
        }
        • Optionalca?: string | string[] | Buffer<ArrayBufferLike>

          Extra trusted CA certificates. This bearer currently forwards only a Buffer value.

        • OptionalcacheFilePath?: string

          Custom shared credentials-file path.

        • OptionalfileCacheThrottleMs?: number

          Minimum interval between cache-file reads. Defaults to five minutes.

        • OptionalinitialRetryTimeoutMs?: number

          Initial renewal backoff. Defaults to one second.

        • OptionalinitialSafetyMarginMs?: number | null

          Extra lifetime required for the first cached token.

          Defaults to two hours. null also selects this default. Valid cache hits keep the margin for later fetches. A fetch clears it only after it proceeds into the renewal path.

        • OptionallifetimeSafeFraction?: number

          Fraction of remaining lifetime to wait before renewal.

          The default 0.9 renews with about 10% of the lifetime left.

        • Optionallogger?: Logger

          Optional destination for diagnostic events.

        • OptionalmaxRetries?: number

          Maximum total authentication attempts for one receiver. Defaults to 2.

        • OptionalmaxRetryTimeoutMs?: number

          Maximum renewal backoff. Defaults to 60 seconds.

        • Optionalmetrics?: AuthMetricsInput

          Optional authentication metrics destination.

        • OptionalnoBrowserOpen?: boolean

          Prevents automatic browser launch when true.

        • OptionalretrySafetyMarginMs?: number

          Reserved for compatibility. The JavaScript implementation does not use this value.

        • OptionalretryTimeoutExponent?: number

          Multiplier for exponential renewal backoff. Defaults to 1.5.

        • OptionaltimeoutMs?: number

          Timeout for the browser callback, in milliseconds.

          This value does not limit the following token HTTP request.

        • Optionalwriter?: (s: string) => void

          Receives the authorization URL. The default writer uses console.log.

      Returns FederationAccountBearer

    $type: "nebius.sdk.FederationAccountBearer" = 'nebius.sdk.FederationAccountBearer'

    Contains the fully qualified runtime type name.

    • get metricProvider(): string

      Returns the provider name for authorization metrics.

      Returns string

    • get name(): string | undefined

      Returns the stable credential name used by file-backed token caches.

      Most bearers do not have a name. Wrappers can add one with NamedBearer.

      Returns string | undefined

    • Stops owned background work and closes the wrapped bearer.

      Parameters

      • OptionalgraceMs: number

      Returns Promise<void>