Skip to content

lucacasonato/deno-aws-sign-v4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno-aws-signer-v4 Build Status

Generates AWS Signature V4 for AWS low-level REST APIs.

Installation

import { AWSSignerV4 } from "https://raw.githubusercontent.com/silver-xu/deno-aws-sign-v4/master/src/mod.ts";

Region & Credentials

The below example will generate signed headers based on the region and credentials in following ENV variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION
const signer = new AWSSignerV4();
const headers = signer.sign("es", endpoint, "POST", payload);

const response = await fetch(endpoint, {
  headers
  method,
  body: payload,
});

Complete setup

const signer = new AWSSignerV4(
  'ap-southeast-2',  // Your real region
  {
    awsAccessKeyId: 1234 // Your real access key id
    awsSecretKey: 1234 // Your real secret key
  });

const headers = signer.sign("es", endpoint, "POST", payload);

const response = await fetch(endpoint, {
  headers
  method,
  body: payload,
});

About

Generates AWS Signature V4 for AWS low-level REST APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.8%
  • Dockerfile 1.2%