We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.StaticTokenProvider

AWS.Token show all
Defined in:


Represents the simplest token provider. It returns a static token string and has an optional expireTime.

Constructor Summary collapse

Property Summary

Properties inherited from AWS.Token

token, expireTime, expired, expiryWindow

Method Summary

Methods inherited from AWS.Token

needsRefresh, get, getPromise, refreshPromise, refresh

Constructor Details

new AWS.StaticTokenProvider(options) ⇒ void

Creates a new StaticTokenProvider class with a given AWS.StaticTokenProvider.token and optional AWS.StaticTokenProvider.expireTime.

var staticTokenProvider = new AWS.StaticTokenProvider({
  token: 'token'
staticTokenProvider.token == 'token' // from constructor

Options Hash (options):

  • token (String)

    represents the literal token string.

  • expireTime (Date)

    optional field representing the time at which the token expires.