1.0.1 • Published 9 years ago

gmaps-signer v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

gmaps-signer

gmaps-signer is a small package which allows you to sign requests to Google Maps API for Work Web Services according to the specification.

The module is a single function which accepts a URL (with or without a hostname) and your web-safe Base64 encoded signing key and returns the URL with the &signature=... part appended.

Example

var sign = require("gmaps-signer")
// Can also be called with just /maps/api/geocode/json?latlng=0,0&client=gme-yourclientid
var signed = sign("https://maps.googleapis.com/maps/api/geocode/json?latlng=0,0&client=gme-yourclientid", "Y0ur-Api-S1gn1NG-kEyHERE=")

signed == "https://maps.googleapis.com/maps/api/geocode/json?latlng=0,0&client=gme-yourclientid&signature=gbtkKNR9gWP7AYeMUjKsEV4OQZY=" //true