Setting credentials in a web browser - Amazon SDK for JavaScript
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

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

Starting October 1, 2022, Amazon SDK for JavaScript (v3) will end support for Internet Explorer 11 (IE 11). For details, see Announcing the end of support for Internet Explorer 11 in the Amazon SDK for JavaScript (v3).

Setting credentials in a web browser

There are several ways to supply your credentials to the SDK from browser scripts. Some of these are more secure and others afford greater convenience while developing a script.

Here are the ways you can supply your credentials, in order of recommendation:

  1. Using Amazon Cognito Identity to authenticate users and supply credentials

  2. Using web federated identity

  3. Hard coding in the script

Warning

We do not recommend hard coding your Amazon credentials in your scripts. Hard coding credentials poses a risk of exposing your access key ID and secret access key.