If you are upgrading from 1.x to 2.0 of the SDK, please see the upgrading notes for information on how to migrate existing code to work with the new major version.
To use the SDK in the browser, simply add the following script tag to your HTML pages:
You can also build a custom browser SDK with your specified set of AWS services. This can allow you to reduce the SDK's size, specify different API versions of services, or use AWS services that don't currently support CORS if you are working in an environment that does not enforce CORS. To get started:
The AWS SDK is also compatible with browserify.
For browser-based web, mobile and hybrid apps, you can use AWS Amplify Library which extends the AWS SDK and provides an easier and declarative interface.
The preferred way to install the AWS SDK for Node.js is to use the npm package manager for Node.js. Simply type the following into a terminal window:
npm install aws-sdk
To use the SDK in a react native project, first install the SDK using npm:
npm install aws-sdk
Then within your application, you can reference the react native compatible version of the SDK with the following:
var AWS = require('aws-sdk/dist/aws-sdk-react-native');
Alternatively, you can use AWS Amplify Library which extends AWS SDK and provides React Native UI components and CLI support to work with AWS services.
You can also use Bower to install the SDK by typing the following into a terminal window:
bower install aws-sdk-js
You can find a getting started guide at:
API reference at:
.d.tsfiles. Our goal is to keep these TypeScript definition files updated with each release for any public api.
Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements:
Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window:
npm install --save-dev @types/node
If you are targeting at es5 or older ECMA standards, your
tsconfig.jsonhas to include
compilerOptions.lib. See tsconfig.json for an example.
To use the TypeScript definition files with the global
This will provide support for the global
To use the TypeScript definition files within a Node.js project, simply import
aws-sdkas you normally would.
In a TypeScript file:
// import entire SDK import AWS from 'aws-sdk'; // import AWS object without services import AWS from 'aws-sdk/global'; // import individual service import S3 from 'aws-sdk/clients/s3';
NOTE: You need to add
"esModuleInterop": trueto compilerOptions of your
tsconfig.json. If not possible, use like
import * as AWS from 'aws-sdk'.
// import entire SDK var AWS = require('aws-sdk'); // import AWS object without services var AWS = require('aws-sdk/global'); // import individual service var S3 = require('aws-sdk/clients/s3');
To create React applications with AWS SDK, you can use AWS Amplify Library which provides React components and CLI support to work with AWS services.
Due to the SDK's reliance on node.js typings, you may encounter compilation issues when using the typings provided by the SDK in an Angular project created using the Angular CLI.
To resolve these issues, either add
"types": ["node"]to the project's
tsconfig.app.jsonfile, or remove the
AWS Amplify Library provides Angular components and CLI support to work with AWS services.
There are a few known limitations with the bundled TypeScript definitions at this time:
apiVersion, regardless of which
apiVersionis specified when creating a client.
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.
Please see SERVICES.md for a list of supported services.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.