npm install aws-simple-request
const awsApi = require('aws-simple-request');
// assuming your credentials are passed in via process.env
let awsReq = new awsApi.awsRequest(process.env.secretKey, process.env.keyId, process.env.associateTag);
// make the request
awsReq.makeRequest('webservices.amazon.de', '/onca/xml', {
"Operation": "ItemSearch",
"SearchIndex": "Books",
"Service":"AWSECommerceService",
"Title": "Node.js"
}, function (err, response, body) {
if(err) throw err;
console.log(body);
done();
});
Parameters
-
secretKey:
string
, aws secret access key. Should look like 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' -
keyId:
string
, aws access key id. The Identifier for your Key. Should look like 'AKIAIOSFODNN7EXAMPLE' -
associateTag:
string
, AssociateTag Parameter
More Information: docs.aws.amazon.com
Parameters
-
endpoint:
string
, amazon host. For Example: 'webservices.amazon.de' -
path:
string
, For Example: '/onca/xml' -
params:
object
, object which attributes should conform aws docs. -
callback:
function
, function that get called with (error, response, body)
More Information docs.aws.amazon.com