What's the AWS SDK for JavaScript? - AWS SDK for JavaScript

The AWS SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the AWS SDK for JavaScript version 3 (V3).

What's the AWS SDK for JavaScript?

Welcome to the AWS SDK for JavaScript Developer Guide. This guide provides general information about setting up and configuring the AWS SDK for JavaScript. It also walks you through examples and tutorial of running various AWS services using the AWS SDK for JavaScript.

The AWS SDK for JavaScript v3 API Reference Guide provides a JavaScript API for AWS services. You can use the JavaScript API to build libraries or applications for Node.js or the browser.

Relationship between JavaScript environments, the SDK, and Amazon Web Services

Get started with the SDK

If you’re ready to get hands-on with the SDK, follow the examples at Get started with the AWS SDK for JavaScript.

To set up your development environment, see Set up the SDK for JavaScript.

If you’re currently using version 2.x of SDK for JavaScript, see Migrate to v3 for specific guidance.

If you’re looking for code examples for AWS services, see SDK for JavaScript (v3) code examples.

Maintenance and support for SDK major versions

For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Reference Guide:

Using the SDK with Node.js

Node.js is a cross-platform runtime for running server-side JavaScript applications. You can set up Node.js on an Amazon Elastic Compute Cloud (Amazon EC2) instance to run on a server. You can also use Node.js to write on-demand AWS Lambda functions.

Using the SDK for Node.js differs from the way in which you use it for JavaScript in a web browser. The difference comes from the way in which you load the SDK and in how you obtain the credentials needed to access specific web services. When use of particular APIs differs between Node.js and the browser, we call out those differences.

Using the SDK with AWS Cloud9

You can also develop Node.js applications using the SDK for JavaScript in the AWS Cloud9 IDE. For more information about using AWS Cloud9 with the SDK for JavaScript, see Use AWS Cloud9 with the AWS SDK for JavaScript.

Using the SDK with AWS Amplify

For browser-based web, mobile, and hybrid apps, you can also use the AWS Amplify library on GitHub. It extends the SDK for JavaScript, providing a declarative interface.

Note

Frameworks such as Amplify might not offer the same browser support as the SDK for JavaScript. See the framework's documentation for details.

Using the SDK with web browsers

All major web browsers support execution of JavaScript. JavaScript code that is running in a web browser is often called client-side JavaScript.

For a list of browsers that are supported by the AWS SDK for JavaScript, see Supported web browsers.

Using the SDK for JavaScript in a web browser differs from the way in which you use it for Node.js. The difference comes from the way in which you load the SDK and in how you obtain the credentials needed to access specific web services. When use of particular APIs differs between Node.js and the browser, we call out those differences.

Using browsers in V3

V3 enables you to bundle and include in the browser only the SDK for JavaScript files you require, reducing overhead.

To use V3 of the SDK for JavaScript in your HTML pages, you must bundle the required client modules and all required JavaScript functions into a single JavaScript file using Webpack, and add it in a script tag in the <head> of your HTML pages. For example:

<script src="./main.js"></script>
Note

For more information about Webpack, see Bundle applications with webpack.

To use V2 of the SDK for JavaScript, you add a script tag that points to the latest version of the V2 SDK instead. For more information, see the sample in the AWS SDK for JavaScript Developer Guide v2.

Common use cases

Using the SDK for JavaScript in browser scripts makes it possible to realize a number of compelling use cases. Here are several ideas for things you can build in a browser application by using the SDK for JavaScript to access various web services.

  • Build a custom console to AWS services in which you access and combine features across Regions and services to best meet your organizational or project needs.

  • Use Amazon Cognito Identity to enable authenticated user access to your browser applications and websites, including use of third-party authentication from Facebook and others.

  • Use Amazon Kinesis to process click streams or other marketing data in real time.

  • Use Amazon DynamoDB for serverless data persistence, such as individual user preferences for website visitors or application users.

  • Use AWS Lambda to encapsulate proprietary logic that you can invoke from browser scripts without downloading and revealing your intellectual property to users.

About the examples

You can browse the SDK for JavaScript examples in the AWS Code Example Repository.

Resources

In addition to this guide, the following online resources are available for SDK for JavaScript developers: