Sign a URL for Google Maps Platform requests.
Warning:It is not recommended to use this library in client side applications to avoid exposing the secret used to sign the URL.
Available via npm as the package@googlemaps/url-signature.
npm i @googlemaps/url-signature
Check out thereference documentation.
Create a signature for a Google Maps requestURLor url string.
constsignature=createSignature("https://example /some-path?foo=bar","secret");
Returns a newURLhaving a signature parameter.
constsignedUrl=signUrl("https://example /some-path?foo=bar","secret");
signedUrl.href;// "https://example /some-path?foo=bar&signature=..."
Create a signature for a path and query string using Hmac SHA1.
constsignature=createSignatureForPathAndQuery("/some-path?foo=bar","secret");
Note:This is not an officially supported Google product