interface ClientOptions {
    appId: string;
    baseUrl?: string;
    concurrency?: ConcurrencyOptions;
    experimental?: ExperimentalOptions;
    getToken?: (() => Promise<string>);
    oidcTokenProvider?: (() => Promise<string>);
    project: string;
    retryValidator?: RetryValidator;
}

Hierarchy

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?: ConcurrencyOptions

Opt-in per-API request concurrency limits. Requests are not limited unless this is set; {} enables the default limits.

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

experimental?: ExperimentalOptions

Opt-in to new APIs that may still change. These APIs are disabled unless their flag is set; accessing one that is not enabled throws.

const client = new CogniteClient({ ..., experimental: { workflows: true } });

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.