| Server IP : 189.126.111.107 / Your IP : 216.73.217.69 Web Server : Apache System : Linux www.gadotticar.com.br 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 User : gadotticar ( 1000) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gadotticar/frete-api/node_modules/@googlemaps/url-signature/ |
Upload File : |
# Google Maps JavaScript URL Signing
[](https://www.npmjs.com/package/@googlemaps/url-signature)


[](https://codecov.io/gh/googlemaps/js-url-signature)

[](https://github.com/semantic-release/semantic-release)
[](https://github.com/apps/in-solidarity)
## 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](https://www.npmjs.com/package/@googlemaps/url-signature).
`npm i @googlemaps/url-signature`
## Documentation
Check out the [reference documentation](https://googlemaps.github.io/js-url-signature/index.html).
## Example
Create a signature for a Google Maps request [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) or url string.
```ts
const signature = createSignature("https://example.com/some-path?foo=bar", "secret");
```
Returns a new [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) having a signature parameter.
```ts
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.
```ts
const signature = createSignatureForPathAndQuery("/some-path?foo=bar", "secret");
```
> **Note**: This is not an officially supported Google product