A javascript/typescript package to authenticate requests with aws4 signature.
npm install @sujithjr/aws4-request-auth-tsThis is a typescript/javascript package to sign your HTTP requests using aws4 signature. This includes support for both CJS and ESM.
To get started:
``shell`Using bun.js
bun add @sujithjr/aws4-request-auth-ts`shell`Using npm
npm install @sujithjr/aws4-request-auth-ts`shell`Using pnpm
pnpm add @sujithjr/aws4-request-auth-ts`shell`Using yarn
yarn add @sujithjr/aws4-request-auth-ts
Common JS require,
`js`
const awsSign = require('@sujithjr/aws4-request-auth-ts');
ES module import,
`js`
import awsSign from '@sujithjr/aws4-request-auth-ts';
Supports all the HTTP request methods. Example on how to pass required fields to sign the headers,
`js``
const headers = awsSign.signHeaders({
targetUrl: 'https//example.com',
method: 'POST',
body: JSON.stringify({ value: 'some text' }),
awsConfig: {
region: '
accessKey: '
secretKey: '
service: '
}
})