interface ClientOptions {
    appId: string;
    baseUrl?: string;
    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' *

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.