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

    Creates signed JWT assertions for service-account token exchange.

    This object does not call the token service. Use it with ServiceAccountBearer, which exchanges the short-lived assertion and renews the resulting access token.

    import { SDK } from '@nebius/js-sdk';
    import { ServiceAccount } from '@nebius/js-sdk/runtime/service_account/service_account';

    const account = new ServiceAccount(
    process.env.NEBIUS_PRIVATE_KEY_PEM ?? '',
    process.env.NEBIUS_PUBLIC_KEY_ID ?? '',
    process.env.NEBIUS_SERVICE_ACCOUNT_ID ?? '',
    );
    const sdk = new SDK({
    // SDK recognizes this value and creates the connected renewable bearer.
    credentials: account,
    userAgentPrefix: 'example-application/1.0',
    });

    Implements

    Indexable

    • [key: symbol]: (() => string) | (() => object)

      Creates signed JWT assertions for service-account token exchange.

      This object does not call the token service. Use it with ServiceAccountBearer, which exchanges the short-lived assertion and renews the resulting access token.

      • () => string
          • (): string
          • Creates signed JWT assertions for service-account token exchange.

            This object does not call the token service. Use it with ServiceAccountBearer, which exchanges the short-lived assertion and renews the resulting access token.

            Returns string

      • () => object
          • (): object
          • Returns a JSON-safe value for logs.

            Returns object

    Index
    • Creates service-account signing credentials.

      Signing parses and validates the private key. The public-key and service-account IDs are sent as supplied, so the remote service can reject missing or invalid IDs.

      Parameters

      • privateKeyPem: string

        PEM-encoded RSA private key. Treat this value as a secret.

      • publicKeyId: string

        ID of the public key registered for the service account.

      • serviceAccountId: string

        ID of the service account that owns the key.

      • Optionallogger: Logger

        Optional destination for diagnostic events.

      Returns ServiceAccount

    logger?: Logger

    Optional destination for diagnostic events.

    privateKeyPem: string

    PEM-encoded RSA private key. Treat this value as a secret.

    publicKeyId: string

    ID of the public key registered for the service account.

    serviceAccountId: string

    ID of the service account that owns the key.