Gathering detailed insights and metrics for @aws-sdk/client-lambda
Gathering detailed insights and metrics for @aws-sdk/client-lambda
Gathering detailed insights and metrics for @aws-sdk/client-lambda
Gathering detailed insights and metrics for @aws-sdk/client-lambda
aws-sdk-client-mock
Easy and powerful mocking of AWS SDK v3 Clients
aws-sdk-client-mock-jest
Custom Jest matchers for AWS SDK v3 Client mock
@aws-sdk/client-lambda-node
Node SDK for AWS Lambda
@trivikr-test/client-lambda
AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native
Modularized AWS SDK for JavaScript.
npm install @aws-sdk/client-lambda
Typescript
Module System
Min. Node Version
Node Version
NPM Version
90.1
Supply Chain
100
Quality
98.7
Maintenance
100
Vulnerability
99.6
License
TypeScript (99.64%)
Java (0.23%)
JavaScript (0.11%)
Gherkin (0.02%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
245,551,817
Last Day
143,629
Last Week
3,905,366
Last Month
15,152,438
Last Year
154,459,196
Apache-2.0 License
3,217 Stars
8,685 Commits
601 Forks
44 Watchers
12 Branches
169 Contributors
Updated on Feb 18, 2025
Minified
Minified + Gzipped
Latest Version
3.750.0
Package Id
@aws-sdk/client-lambda@3.750.0
Unpacked Size
1.67 MB
Size
183.97 kB
File Count
332
NPM Version
10.9.2
Node Version
18.20.6
Published on
Feb 17, 2025
Cumulative downloads
Total Downloads
Last Day
4.5%
143,629
Compared to previous day
Last Week
2.2%
3,905,366
Compared to previous week
Last Month
27.3%
15,152,438
Compared to previous month
Last Year
100.9%
154,459,196
Compared to previous year
44
6
AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native.
Overview
Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service. For more information about the Lambda service, see What is Lambda in the Lambda Developer Guide.
The Lambda API Reference provides information about each of the API methods, including details about the parameters in each API request and response.
You can use Software Development Kits (SDKs), Integrated Development Environment (IDE) Toolkits, and command line tools to access the API. For installation instructions, see Tools for Amazon Web Services.
For a list of Region-specific endpoints that Lambda supports, see Lambda endpoints and quotas in the Amazon Web Services General Reference..
When making the API calls, you will need to authenticate your request by providing a signature. Lambda supports signature version 4. For more information, see Signature Version 4 signing process in the Amazon Web Services General Reference..
CA certificates
Because Amazon Web Services SDKs use the CA certificates from your computer, changes to the certificates on the Amazon Web Services servers can cause connection failures when you attempt to use an SDK. You can prevent these failures by keeping your computer's CA certificates and operating system up-to-date. If you encounter this issue in a corporate environment and do not manage your own computer, you might need to ask an administrator to assist with the update process. The following list shows minimum operating system and Java versions:
Microsoft Windows versions that have updates from January 2005 or later installed contain at least one of the required CAs in their trust list.
Mac OS X 10.4 with Java for Mac OS X 10.4 Release 5 (February 2007), Mac OS X 10.5 (October 2007), and later versions contain at least one of the required CAs in their trust list.
Red Hat Enterprise Linux 5 (March 2007), 6, and 7 and CentOS 5, 6, and 7 all contain at least one of the required CAs in their default trusted CA list.
Java 1.4.2_12 (May 2006), 5 Update 2 (March 2005), and all later versions, including Java 6 (December 2006), 7, and 8, contain at least one of the required CAs in their default trusted CA list.
When accessing the Lambda management console or Lambda API endpoints, whether through browsers or programmatically, you will need to ensure your client machines support any of the following CAs:
Amazon Root CA 1
Starfield Services Root Certificate Authority - G2
Starfield Class 2 Certification Authority
Root certificates from the first two authorities are available from Amazon trust services, but keeping your computer up-to-date is the more straightforward solution. To learn more about ACM-provided certificates, see Amazon Web Services Certificate Manager FAQs.
To install this package, simply type add or install @aws-sdk/client-lambda using your favorite package manager:
npm install @aws-sdk/client-lambda
yarn add @aws-sdk/client-lambda
pnpm add @aws-sdk/client-lambda
The AWS SDK is modulized by clients and commands.
To send a request, you only need to import the LambdaClient
and
the commands you need, for example ListLayersCommand
:
1// ES5 example 2const { LambdaClient, ListLayersCommand } = require("@aws-sdk/client-lambda");
1// ES6+ example 2import { LambdaClient, ListLayersCommand } from "@aws-sdk/client-lambda";
To send a request, you:
send
operation on client with command object as input.destroy()
to close open connections.1// a client can be shared by different commands. 2const client = new LambdaClient({ region: "REGION" }); 3 4const params = { 5 /** input parameters */ 6}; 7const command = new ListLayersCommand(params);
We recommend using await operator to wait for the promise returned by send operation as follows:
1// async/await. 2try { 3 const data = await client.send(command); 4 // process data. 5} catch (error) { 6 // error handling. 7} finally { 8 // finally. 9}
Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.
You can also use Promise chaining to execute send operation.
1client.send(command).then( 2 (data) => { 3 // process data. 4 }, 5 (error) => { 6 // error handling. 7 } 8);
Promises can also be called using .catch()
and .finally()
as follows:
1client 2 .send(command) 3 .then((data) => { 4 // process data. 5 }) 6 .catch((error) => { 7 // error handling. 8 }) 9 .finally(() => { 10 // finally. 11 });
We do not recommend using callbacks because of callback hell, but they are supported by the send operation.
1// callbacks. 2client.send(command, (err, data) => { 3 // process err and data. 4});
The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript
1import * as AWS from "@aws-sdk/client-lambda"; 2const client = new AWS.Lambda({ region: "REGION" }); 3 4// async/await. 5try { 6 const data = await client.listLayers(params); 7 // process data. 8} catch (error) { 9 // error handling. 10} 11 12// Promises. 13client 14 .listLayers(params) 15 .then((data) => { 16 // process data. 17 }) 18 .catch((error) => { 19 // error handling. 20 }); 21 22// callbacks. 23client.listLayers(params, (err, data) => { 24 // process err and data. 25});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
1try { 2 const data = await client.send(command); 3 // process data. 4} catch (error) { 5 const { requestId, cfId, extendedRequestId } = error.$metadata; 6 console.log({ requestId, cfId, extendedRequestId }); 7 /** 8 * The keys within exceptions are also parsed. 9 * You can access them by specifying exception names: 10 * if (error.name === 'SomeServiceException') { 11 * const value = error.specialKeyInException; 12 * } 13 */ 14}
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js
.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-lambda
package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
No vulnerabilities found.
Reason
30 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
binaries present in source code
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
18 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More