https://github.com/yandex-cloud/nodejs-sdk
Yandex.Cloud NodeJS SDK
https://github.com/yandex-cloud/nodejs-sdk
cloud nodejs sdk yandex-cloud
Last synced: 3 months ago
JSON representation
Yandex.Cloud NodeJS SDK
- Host: GitHub
- URL: https://github.com/yandex-cloud/nodejs-sdk
- Owner: yandex-cloud
- License: mit
- Created: 2019-07-07T11:58:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2026-04-15T07:15:18.000Z (3 months ago)
- Last Synced: 2026-04-15T08:30:31.363Z (3 months ago)
- Topics: cloud, nodejs, sdk, yandex-cloud
- Language: TypeScript
- Homepage:
- Size: 13 MB
- Stars: 73
- Watchers: 6
- Forks: 17
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# Yandex.Cloud SDK (nodejs)
[](https://www.npmjs.com/package/@yandex-cloud/nodejs-sdk)
[](https://github.com/yandex-cloud/nodejs-sdk/blob/master/LICENSE)
Need to automate your infrastructure or use services provided by Yandex.Cloud? We've got you covered.
## Requirements
- nodejs >= 22.15
## Installation
`npm install @yandex-cloud/nodejs-sdk`
## Getting started
There are three options for authorization your requests:
- [IAM token](https://cloud.yandex.com/en-ru/docs/iam/operations/iam-token/create)
- [Metadata Service](https://cloud.yandex.com/en-ru/docs/compute/concepts/vm-metadata) (if you're executing code inside VMs or Functions
running in Yandex.Cloud)
### Metadata Service
Don't forget to assign Service Account for your Instance or Function.
```typescript
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,
}));
```
### IAM Token
```typescript
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](./examples) directory for more examples.
To run example scripts, you should execute the following commands:
```bash
cd examples
npm i
YC_IAM_TOKEN=... YC_FOLDER_ID=... npm run start path/to/example.ts
```
P.S If you need generated client for other Yandex.Cloud services, just open an issue.