Just a nodejs wrapper over AWS4 signer
$ yarn add @nutshelllab/node-aws-signer
import sign from '@nutshelllab/node-aws-signer'
(async () => {
const method = 'POST'
const url = 'https://api.behindawsgateway.com/resources'
const headers = { from: 'my-super-app' }
const body = { name: 'MyResource' }
const signedRequest = await sign(method, url, headers, body)
return fetch(signedRequest.url, signedRequest)
})
Type: string
HTTP method (GET
, POST
, PUT
, PATCH
, DELETE
, ...).
Type: string
Request endpoint.
Type: Object
Headers to be added to the request.
Type: Object
Request JSON payload.
MIT © Nutshell