Superagent plugin that intercepts and signs the request with AWS Signature V4
Usage ParamsTo find the appropriate service name to use, a helpful resource is the Amazon Resource Names (ARNs) and AWS Service Namespaces page.
Note: Some services like API Gateway while having a namespace of apigateway
, actually require you to pass execute-api
if you are trying to make a request to the api hosted there. If you choose the wrong service name, an error should be returned with the service name you need, based on the service you are making a request to.
Installconst request = require('superagent');
const signRequest = require('superagent-aws-signed-request');
Â
const awsService = 'execute-api';Â
return request
  .get()
  .use(signRequest(service, {
    key: 'AWS_ACCESS_KEY_ID',Â
    secret: 'AWS_SECRET_ACCESS_KEY',Â
    region: 'AWS_REGION',Â
    sessionToken: 'sessionToken',Â
  }))
  .then( resp => console.log(resp));
It's available on npm so you can simply install it with:
npm install --save superagent-aws-signed-request
Package Sidebar Install
npm i superagent-aws-signed-request
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4