1.0.2 • Published 6 months ago

@sujithjr/aws4-request-auth-ts v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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>',
  }
})
1.0.2

6 months ago

1.0.1

8 months ago

1.0.0

8 months ago