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

    Adds in-memory renewal to ImpersonatedBearer.

    Use this variant for normal SDK requests so repeated calls reuse the impersonated access token until renewal is required.

    import { SDK } from '@nebius/js-sdk';
    import { CachedImpersonatedBearer } from '@nebius/js-sdk/runtime/token/impersonated';
    import { EnvBearer } from '@nebius/js-sdk/runtime/token/static';

    // This SDK makes the unauthenticated token-exchange RPC.
    const exchangeSdk = new SDK({
    userAgentPrefix: 'example-application/1.0',
    });
    const credentials = new CachedImpersonatedBearer(
    'serviceaccount-e00example',
    new EnvBearer(),
    exchangeSdk,
    );
    const sdk = new SDK({
    credentials,
    userAgentPrefix: 'example-application/1.0',
    });

    try {
    // Use sdk clients here.
    } finally {
    await sdk.close();
    await exchangeSdk.close();
    }

    Hierarchy (View Summary)

    • Bearer
      • CachedImpersonatedBearer
    Index
    $type: "nebius.sdk.CachedImpersonatedBearer" = 'nebius.sdk.CachedImpersonatedBearer'

    Contains the fully qualified runtime type name.

    • get metricProvider(): string

      Returns the provider name for authorization metrics.

      Returns string

    • Stops owned background work and closes the wrapped bearer.

      Parameters

      • OptionalgraceMs: number

      Returns Promise<void>