1.0.0 • Published 4 years ago
@antavo/api-signature-node v1.0.0
Antavo API Signature
Antavo API Signature helps you creating secure HTTP requests (for APIs) by signing HTTP(s) requests.
Usage
Create a timestamp integer through the following snippet:
var time = 1 * (new Date().getTime() / 1000).toFixed(0)
Initialize a new Signer object this way:
var signer = new Signer(ENVIRONMENT, API_KEY, API_SECRET, time)
Calculate the signature string like this:
var signature = signer.calculateSignature(HTTP_METHOD, REQUEST_URL, REQUEST_DATA)
Create the Authorization header, and append it to the request:
var header = signer.getAuthorizationHeader(signature)
1.0.0
4 years ago