Package Exports
- @aws-sdk/token-providers
- @aws-sdk/token-providers/dist-cjs/index.js
- @aws-sdk/token-providers/dist-es/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@aws-sdk/token-providers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@aws-sdk/token-providers
A collection of all token providers. The token providers should be used when the authorization
type is going to be token based. For example, the bearer authorization type set using
httpBearerAuth trait in Smithy.
Static Token Provider
import { fromStatic } from "@aws-sdk/token-providers"
const token = { token: "TOKEN" };
const staticTokenProvider = fromStatic(token);
cont staticToken = await staticTokenProvider(); // returns { token: "TOKEN" }SSO Token Provider
import { fromSso } from "@aws-sdk/token-providers"
// returns token from SSO token cache or ssoOidc.createToken() call.
cont ssoToken = await fromSso();Token Provider Chain
import { nodeProvider } from "@aws-sdk/token-providers"
// returns token from default providers.
cont token = await nodeProvider();