Socket
Socket
Sign inDemoInstall

gme-signature

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gme-signature

Generate sign url by clientID and private key.


Version published
Weekly downloads
3
decreased by-70%
Maintainers
1
Install size
4.65 kB
Created
Weekly downloads
 

Readme

Source

REF: https://developers.google.com/maps/documentation/directions/get-api-key#digital-signature-premium

Usage

/** Sign url with clientId in url */
const sign = require('gme-signature')
const privateKey = 'vNIXE0xscrmjlyV-12Nj_BvUPaw=' // Example from the link
const url = 'https://maps.googleapis.com/maps/api/geocode/json?address=New+York&client=clientID'
const signed = sign(url, privateKey)
console.log(signed) // 'https://maps.googleapis.com/maps/api/geocode/json?address=New+York&client=clientID&signature=chaRF2hTJKOScPr-RQCEhZbSzIE='

/** Sign url without clientId in url */
const sign = require('gme-signature')
const privateKey = 'vNIXE0xscrmjlyV-12Nj_BvUPaw=' // Example from the link
const clientId = 'clientID'
const url = 'https://maps.googleapis.com/maps/api/geocode/json?address=New+York'
const signed= sign(url, privateKey, clientId)
console.log(signed) // 'https://maps.googleapis.com/maps/api/geocode/json?address=New+York&client=clientID&signature=chaRF2hTJKOScPr-RQCEhZbSzIE='

/** Example with directions api */
const sign = require('gme-signature')
const privateKey = 'vNIXE0xscrmjlyV-12Nj_BvUPaw=' // Example from the link
const url = 'https://maps.googleapis.com/maps/api/directions/json?origin=25.0626333,121.515451&destination=25.064742,121.516717&client=clientID'
const signed = sign(url, privateKey)
console.log(signed) // 'https://maps.googleapis.com/maps/api/directions/json?origin=25.0626333,121.515451&destination=25.064742,121.516717&client=clientID&signature=MR1Qc7fTFlRGF5KqKmZV05i95rg='

Keywords

FAQs

Last updated on 28 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc