interface ClientOptions {
    appId: string;
    baseUrl?: string;
    concurrency?: Readonly<Record<string, undefined | Readonly<Record<string, undefined | number>>>>;
    getToken?: (() => Promise<string>);
    oidcTokenProvider?: (() => Promise<string>);
    project: string;
    retryValidator?: RetryValidator;
}

Properties

appId: string

App identifier (ex: 'FileExtractor') This is a free-text string that will be used to identify your application.

baseUrl?: string

URL to Cognite cluster, e.g 'https://greenfield.cognitedata.com' *

concurrency?: Readonly<Record<string, undefined | Readonly<Record<string, undefined | number>>>>

Opt-in per-API concurrency limits, keyed by API name (for example dataModeling). Requests are not limited unless this is set; an empty object enables the default limits of every API the SDK package supports.

This functionality is experimental. Breaking changes are to be expected in any release, including patch and minor versions.

getToken?: (() => Promise<string>)

Use oidcTokenProvider instead.

oidcTokenProvider?: (() => Promise<string>)

Will be invoked when the SDK needs to authenticate against the CDF API. The function should return a valid access token to be used against the CDF API. The function will be called when the API returns 401 (Unauthorized) or when someone calls BaseCogniteClient.authenticate.

It is the responsibility of the user to get hold of a valid access token to pass into the SDK.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

      A string representing the raw access token to be used against the CDF API.

project: string

Project name

retryValidator?: RetryValidator

Used to override the default retry validator.