Next: Configuring the SDK for JavaScript, Previous: Setting Up the SDK for JavaScript, Up: SDK for JavaScript Documentation [Index]
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-the-jssdk.html
After you install the SDK, you can load the AWS package in your node
application using require
.
var AWS = require('aws-sdk');
The quickest way to get started with the SDK is to load the hosted SDK package directly from Amazon Web Services. To do this, add a ‘<script>’ element to your HTML pages in the following form:
<script src="https://sdk.amazonaws.com/js/aws-sdk-SDK_VERSION_NUMBER.min.js"></script>
To find the current ‘SDK_VERSION_NUMBER’, see the API Reference for the SDK for JavaScript at:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html.
After the SDK loads in your page, the SDK is available from the global variable
AWS (or window.AWS
).
If you bundle your code and module dependencies using browserify, you load the SDK using require, just as you do in Node.js.