API Reference

@aws-sdk/credential-providers

Credential provider functions for the AWS SDK v3, sourcing credentials from env, INI, instance metadata, and SSO.

Official Documentation ↗
CompatibilityThis documentation covers version v3.658. Check the official docs for the latest API surface.

Installation

npmnpm install @aws-sdk/credential-providers

Methods

@aws-sdk/credential-providers is credential provider functions for the aws sdk v3, sourcing credentials from env, ini, instance metadata, and sso. This page documents the core methods, installation, and common usage patterns for the current stable release.

Installation

Install @aws-sdk/credential-providers with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.

Core methods

The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v3.658 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.

Frequently asked questions

The faq section in the frontmatter answers the most common questions about @aws-sdk/credential-providers, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.

FAQ

How do I chain providers?
Use fromContainerMetadata or a custom chain; the SDK default chain checks env, INI, IMDS, and SSO in order.
Does it support SSO?
Yes. Use fromSso({ profile }) to load SSO credentials.
Can I cache credentials?
The SDK caches automatically; credentials refresh before expiry.