Client options
import { CogniteClient } from '@cognite/sdk';
const client = new CogniteClient({ appId: 'YOUR APPLICATION NAME' });
// can also specify a base URL
const client = new CogniteClient({ ..., baseUrl: 'https://greenfield.cognitedata.com' });
ReadonlyprojectAsset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric 3D contextualization is deprecated 2026-10-15; no retirement date is announced. Use the 3D contextualization APIs in data modeling (public preview, not in this SDK yet). Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.
OptionaloperationOptionalvariables?: TVariablesTemplates API was retired 2025-05-31 and will be removed in the next major release. See https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md for details.
Retirement date: 2027-02-17. See https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features for more details.
Basic HTTP method for DELETE
The URL path
Optionaloptions: RetryableHttpRequestOptionsRequest options, optional
const response = await client.delete('someUrl');
Basic HTTP method for GET
The URL path
Optionaloptions: RetryableHttpRequestOptionsRequest options, optional
const response = await client.get('/api/v1/projects/{project}/assets', { params: { limit: 50 }});
Returns the default HTTP request headers, including e.g. authentication headers that is included in all requests. Headers provided per-requests is not included in this list. This function is useful when constructing API requests outside the SDK.
const customUrl = '...';
const headers = client.getDefaultRequestHeaders();
const result = await fetch(customUrl, { headers });
Basic HTTP method for PATCH
The URL path
Optionaloptions: RetryableHttpRequestOptionsRequest options, optional
const response = await client.patch('someUrl');
Basic HTTP method for POST
The URL path
Optionaloptions: RetryableHttpRequestOptionsRequest options, optional
const assets = [{ name: 'First asset' }, { name: 'Second asset' }];
const response = await client.post('/api/v1/projects/{project}/assets', { data: { items: assets } });
Basic HTTP method for PUT
The URL path
Optionaloptions: RetryableHttpRequestOptionsRequest options, optional
const response = await client.put('someUrl');
Staticurl
Create a new SDK client