aws-api-gateway-fetch
An npm library wraps the signature generation parts of calling an aws api gateway, allowing us to treat it like any other fetch.
Usage
const gateWayFetch = require('@salecycle/aws-api-gateway-fetch');
const result = await gateWayFetch.apiGatewayFetch(
'http://targeturl,
{
accessKeyId: 'AWS_ACCESS_KEY_ID,
region: 'AWS_REGION',
secretAccessKey: 'AWS_SECRET_ACCESS_KEY',
sessionToken: 'OPTIONAL_SECURITY_TOKEN_NEEDED_IF_A_TEMPORARY_KEY'
}
);
apart from the call to the inital method everything else will work like a normal fetch
Development
built with
- nodejs
- typescript
non local requirements
- yarn -
brew install yarn
running locally
-
yarn
- install packages -
yarn build
build the js outputs from the typescript inputs -
yarn link
It's a library so you will need to link it to something that uses it, but you need to link the js version, not the typescript version