Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Developing in Node.js
  2. Using the SDK

Using the SDK for Node.js functions

Written by
Yandex Cloud
Improved by
Anton P.
Updated at September 23, 2024

To use the SDK (Software Development Kit), you have to add the dependency @yandex-cloud/nodejs-sdk to the Node.js application. The library source code is available on GitHub.

{
  "name": "my-awesome-package",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
      "@yandex-cloud/nodejs-sdk": "latest"
  }
}

The SDK (Software Development Kit) helps you manage Yandex Cloud resources on behalf of the service account specified in the function parameters. For example, you can retrieve a list of available clouds:

import { serviceClients, Session, cloudApi } from '@yandex-cloud/nodejs-sdk';

const { resourcemanager: { cloud_service: { ListCloudsRequest } } } = cloudApi;

export const handler = async function (event, context) {
    const session = new Session({ iamToken: context.token.access_token }); // You do not need to specify the iamToken explicitly: it will be extracted automatically from metadata service
    const client = session.client(serviceClients.CloudServiceClient);
    const response = await client.list(ListCloudsRequest.fromPartial({ pageSize: 200 }))

    return {
        statusCode: 200,
        body: {
            clouds: response.clouds,
        }
    };
};

Was the article helpful?

Previous
Handling errors
Next
Overview
© 2025 Direct Cursus Technology L.L.C.