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

    Reads credentials and SDK defaults from a Nebius CLI configuration file.

    Construction reads and validates the YAML file synchronously. The file must exist even when an environment token supplies the credentials. The selected profile can provide parent-id, endpoint, federation credentials, a token file, or service account credentials.

    Pass this object as SDKOptions.configReader. The SDK then uses its endpoint, parent ID, and credentials. An environment access token has priority over profile credentials.

    import { SDK } from '@nebius/js-sdk';
    import { Config } from '@nebius/js-sdk/runtime/cli_config';

    const config = new Config({
    clientId: 'example-application',
    profile: 'default',
    });
    const sdk = new SDK({
    configReader: config,
    userAgentPrefix: 'example-application/1.0',
    });
    try {
    console.log(await sdk.whoami());
    } finally {
    await sdk.close();
    }

    The file is missing or unreadable, the YAML cannot be parsed, or the selected profile is invalid. Semantic profile errors are instances of ConfigError.

    Implements

    Indexable

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

      Reads credentials and SDK defaults from a Nebius CLI configuration file.

      Construction reads and validates the YAML file synchronously. The file must exist even when an environment token supplies the credentials. The selected profile can provide parent-id, endpoint, federation credentials, a token file, or service account credentials.

      Pass this object as SDKOptions.configReader. The SDK then uses its endpoint, parent ID, and credentials. An environment access token has priority over profile credentials.

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

          Returns unknown

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

    Contains the fully qualified runtime type name.

    emitsCredentialsResolveMetrics: true

    Tells the SDK that this reader reports its own credential-resolution metrics.

    • Returns the configured service endpoint.

      An explicit option has priority over the endpoint environment variable. The environment value has priority over the profile value.

      Returns string | undefined

    • Creates credentials for the selected source.

      The order is: environment token, profile token file, then the profile auth-type. Supported auth types are federation and service account. When impersonation is set, the returned bearer exchanges these credentials for the target service account.

      Credential objects normally perform network work when the first SDK request asks for a token. Federation credentials can open a browser at that time.

      Parameters

      Returns Credentials

      ConfigError Credential fields are missing or invalid.