Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Error handling
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Developing in Node.js
  2. Using the SDK

Using the SDK for a function in Node.js

Written by
Yandex Cloud
Improved by
Anton P.
Updated at May 8, 2026
View in Markdown

To use the SDK (Software Development Kit), you need to add the @yandex-cloud/nodejs-sdk dependency to the Node.js app. 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 helps you manage Yandex Cloud resources using the service account specified in the function parameters. For example, you can get a list of available clouds:

import { Session } from '@yandex-cloud/nodejs-sdk';
import { cloudService } from '@yandex-cloud/nodejs-sdk/resourcemanager-v1';

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(cloudService.CloudServiceClient);
    const response = await client.list(cloudService.ListCloudsRequest.fromPartial({}))

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

Was the article helpful?

Previous
Error handling
Next
Overview
© 2026 Direct Cursus Technology L.L.C.