1.0.7 • Published 4 years ago

@cm-madlabs/aws-apigateway-sigv4 v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

AWS API Gateway SigV4

Create request header for IAM authentication of API Gateway

install

yarn add @cm-madlabs/aws-apigateway-sigv4

Usage

import { createSigV4Header } from '@cm-madlabs/aws-apigateway-sigv4';
import axios from 'axios';

const accessKey = process.env.AWS_ACCESS_KEY_ID!;
const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY!
const sessionToken = process.env.AWS_SESSION_TOKEN!;
const region = 'ap-northeast-1';
const url = process.env.API_GATEWAY_URL!;

(async () => {
    const res = await axios.get(url, {
        headers: createSigV4Header({
            accessKey,
            secretAccessKey,
            sessionToken,
            region,
            url,
            method: 'GET',
        })
    });
    console.log(res);
})();
1.0.7

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago