Axios request interceptor for signing HTTP requests with AWS Signature Version 4 (AWSv4). Version 3.4.0 requires Node >=16 and axios >=1.6.0. Supports explicit credentials, custom credential providers, and content SHA headers for services like OpenSearch Serverless. v3 includes a breaking API change: options are now nested under an `options` property. Ships TypeScript definitions. Suitable for accessing AWS services protected by IAM auth (e.g., API Gateway).
npm install aws4-axiosNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an Axios interceptor that signs requests with AWS Signature V4 using explicit credentials from environment variables. Use with an Axios instance.
Wrap your options in { options: { region: '...', service: '...' } }.Pin axios to '>=1.4.0 <=1.6.7' in your package.json.
Implement a CredentialsProvider that assumes the role via STS and returns temporary credentials.
Do not reuse Axios config objects; create fresh configs per request or clone before signing.
Use import syntax or enable ESM in your project.
Use { options: { region: '...', service: '...' } }.Ensure the provider has an async getCredentials method returning an object with accessKeyId and secretAccessKey.