@sujithjr/aws4-request-auth-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

aws4-request-auth-ts

This is a typescript/javascript package to sign your HTTP requests using aws4 signature. This includes support for both CJS and ESM.

To get started:

# Using bun.js
bun add @sujithjr/aws4-request-auth-ts
# Using npm
npm install @sujithjr/aws4-request-auth-ts
# Using pnpm
pnpm add @sujithjr/aws4-request-auth-ts
# Using yarn
yarn add @sujithjr/aws4-request-auth-ts

Common JS require,

const awsSign = require('@sujithjr/aws4-request-auth-ts');

ES module import,

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,

const headers = awsSign.signHeaders({
  targetUrl: 'https//example.com',
  method: 'POST',
  body: JSON.stringify({ value: 'some text' }),
  awsConfig: {
      region: '<aws-region>',
      accessKey: '<aws-access-key>',
      secretKey: '<aws-secret-key>',
      service: '<aws-service>',
  }
})

Package Sidebar

Install

npm i @sujithjr/aws4-request-auth-ts

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

13.2 kB

Total Files

7

Last publish

Collaborators

  • skaey