Need to automate your infrastructure or use services provided by Yandex.Cloud? We've got you covered.
- nodejs >= 22.15
npm install @yandex-cloud/nodejs-sdk
There are three options for authorization your requests:
- IAM token
- Metadata Service (if you're executing code inside VMs or Functions running in Yandex.Cloud)
Don't forget to assign Service Account for your Instance or Function.
import { Session} from '@yandex-cloud/nodejs-sdk';
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';
// Initialize SDK with your token
const session = new Session();
// Create service client
const cloudServiceClient = session.client(cloudService.CloudServiceClient);
// Issue request (returns Promise)
const response = await cloudServiceClient.list(cloudService.ListCloudsRequest.fromPartial({
pageSize: 100,
}));import { Session } from '@yandex-cloud/nodejs-sdk';
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';
// Initialize SDK with your token
const session = new Session({ iamToken: 'YOUR_TOKEN' });
// Create service client
const cloudServiceClient = session.client(cloudService.CloudServiceClient);
// Issue request (returns Promise)
const response = await cloudServiceClient.list(cloudService.ListCloudsRequest.fromPartial({
pageSize: 100,
}));Check examples directory for more examples.
To run example scripts, you should execute the following commands:
cd examples
npm i
YC_IAM_TOKEN=... YC_FOLDER_ID=... npm run start path/to/example.tsP.S If you need generated client for other Yandex.Cloud services, just open an issue.