Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
google-places-web
Advanced tools
V2 is a complete rewrite to provide better TypeScript support and infrastructure for validations with more flexibility. Google Places Web provides a singleton (default) and exported class to make it flexible and easy to use. There are breaking changes so please read through the readme below.
A promise-based integration with Google Places for Node or server-side JS platforms. This cannot be used as a front-end solution (Angular/React/Vue/Vanilla, etc) because Google has provided their own client JS SDK
Radar Search and Find Place Search have been deprecated and removed from the library.
Please note that the google docs aren't always thorough at describing the format of results you get from each endpoint. I have spend a good amount of time trying to make sure the response types are as accurate as possible. If something is not accurate, feel free to open a pull request explaining the inconsistency with the correction.
# with yarn
yarn add google-places-web
# with npm
npm i google-places-web -S
// ES6
import Places from 'google-places-web';
Places.apiKey = 'your-api-key';
const search = await Places.nearbysearch({...});
const search2 = await Places.details({...});
Make sure you have the dependencies installed (yarn
) and have built it with yarn build
.
create a .env
with your PLACES_API_KEY
to make testing and development easier.
# uses the PLACES_API_KEY from .env file and is required
> yarn run:example examples/{search}-example.ts
create a .env
with your PLACES_API_KEY
to make testing and development easier.
Feel free to file issues as you see fit, and always looking for collaborators to help make this better. If you are interested in contributing, you may clone the repository, and create a .ts
file for an example you think would benefit to share.
INVALID_REQUEST
- Google is respondig saying that your parameters provided is invalid.Invalid API Key
- The instance of the GooglePlaces
object does not have a valid API key from Google. Make sure you are either using import Places from...
or import {GooglePlaces} from...
. GooglePlaces
is the base class so you would need to make an instance of it first.STATUS_MESSAGE
- Google responds with HTTP 200 but JSON contains an "error". This is parsed from the Google API response, ex. ZERO_RESULTS
Missing required params: [<PARAM1>, <PARAM2>]
- Required params PARAM1 & PARAM2 are undefined
or null
No parameters provided
- A method was called without passing a parameters object to the method, most likely passed null
, undefined
or nothing. ex. Places.autocomplete();
instead of Places.autcomplete({foo: 'bar'});
Google states that you can use Place Autocomplete even without a map. If you do show a map, it must be a Google map. When you display predictions from the Place Autocomplete service without a map, you must include the Powered by Google logo.
FAQs
A simple wrapper for the Google Places Web API
The npm package google-places-web receives a total of 1,196 weekly downloads. As such, google-places-web popularity was classified as popular.
We found that google-places-web demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.