Skip to content

zackdotcomputer/js-url-signature

This branch is 5 commits ahead of, 50 commits behind googlemaps/js-url-signature:main.

Folders and files

NameName
Last commit message
Last commit date
Dec 5, 2023
Nov 11, 2021
Oct 21, 2021
Oct 21, 2021
Oct 27, 2021
Oct 21, 2021
Oct 21, 2021
Oct 21, 2021
Oct 21, 2021
May 10, 2022
Oct 25, 2021
Oct 21, 2021
Aug 2, 2024
Jul 29, 2024
Nov 22, 2021
Nov 22, 2021
Oct 21, 2021

Repository files navigation

Google Maps JavaScript URL Signing

npm Build Release codecov GitHub contributors semantic-release

Description

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.

Install

Available via npm as the package @googlemaps/url-signature.

npm i @googlemaps/url-signature

Documentation

Check out the reference documentation.

Example

Create a signature for a Google Maps request URL or url string.

const signature = createSignature("https://example.com/some-path?foo=bar", "secret");

Returns a new URL having a signature parameter.

const signedUrl = signUrl("https://example.com/some-path?foo=bar", "secret");
signedUrl.href; // "https://example.com/some-path?foo=bar&signature=..."

Create a signature for a path and query string using Hmac SHA1.

const signature = createSignatureForPathAndQuery("/some-path?foo=bar", "secret");

Note: This is not an officially supported Google product

About

Sign a URL for Google Maps Platform requests.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.6%
  • JavaScript 33.4%