aws4-browser-lite
v1.0.2
Published
Dependency free, browser based version of aws4
Downloads
8
Readme
Dependency free, browser-only version of https://www.npmjs.com/package/aws4
Signs AWS Api Requests https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
Usage
import { AwsRequestSigner } from 'aws4-browser-lite';
let signedRequest = await AwsRequestSigner.quickSign({
service: 'sns',
path: '/?Action=Publish&Version=2010-03-31&TargetArn={TARGET_ARN}&Message={MESSAGE}'
}, {accessKeyId: '', secretAccessKey: ''});
fetch(`https://${signedRequest.hostname}${signedRequest.path}`, {
method: signedRequest.method,
headers: signedRequest.headers
});