Supported Node.js versions
The SDK supports Node.js 22, 24 and 25.Installation and update
Install the SDK package:Initialization and authentication
For server-to-server communication, use a service account to authenticate SDK requests. The SDK uses the service account credentials to generate a JSON Web Token, exchange it for an IAM token and refresh the IAM token in the background.For local usage, authenticate SDK requests by using an IAM token, CLI configuration or service account credentials. For more information, see the JavaScript SDK repository.
- Create a service account.
-
Generate an authorized key and create a service account credentials file:
In the command, set the following parameters:
--service-account-id: ID of your service account.--output: Path to the service account credentials file, for example,credentials.json.
-
Initialize the SDK with the service account credentials file:
In the script, set the following parameters:
<application_name>/<application_version_or_comment>: Application or library that calls the SDK. The version or comment is optional.<credentials_file_path>: Path to the service account credentials file.
SDKconstructor initializes the SDK and uses the service account credentials file to authenticate requests. TheuserAgentPrefixargument adds a prefix to the User-Agent header sent with each request. UseuserAgentPrefixto identify your application in the list of requests.