
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@kreonovo/places-autocomplete-svelte
Advanced tools
A lightweight and customizable Svelte component for easy integration of Google Maps Places Autocomplete (New API) in your Svelte/SvelteKit applications. Provides accessible autocomplete suggestions and detailed address retrieval.
This Svelte component leverages the Google Maps Places Autocomplete API to provide a user-friendly way to search for and retrieve detailed address information within your SvelteKit applications.
Preview this package Demo
npm i places-autocomplete-svelte
npm i places-autocomplete-svelte@1.0.1
'___YOUR_API_KEY___'
with your actual Google Maps API key.onResponse
callback to receive the selected place details.<script>
import { PlaceAutocomplete } from 'places-autocomplete-svelte';
const PUBLIC_GOOGLE_MAPS_API_KEY = '___YOUR_API_KEY___';
let fullResponse = $state('')
let onResponse = (response) => {
console.log(response)
fullResponse = response;
};
</script>
<PlaceAutocomplete {onResponse} {PUBLIC_GOOGLE_MAPS_API_KEY} />
<p>Response Object: {JSON.stringify(fullResponse, null, 2)}</p>
Use optional countries
property to refine search by region:
<script>
// ... other imports
let countries = [
{ name: 'United Kingdom', region: 'GB', language: 'en-GB' },
{ name: 'United States', region: 'US', language: 'en-US' }
// ... more countries
];
</script>
<PlaceAutocomplete {onResponse} {PUBLIC_GOOGLE_MAPS_API_KEY} bind:countries/>
region
code follows the CLDR two-character format.language
in which to return results. See detailsThe component will throw an error if:
Handle these errors gracefully in your application:
<script>
// ... other imports
// Error handler
let pacError = '';
let onError = (error: string) => {
console.error(error);
pacError = error;
};
</script>
<PlaceAutocomplete {onError} {onResponse} {PUBLIC_GOOGLE_MAPS_API_KEY} />
{#if pacError}
<p class="error">{pacError}</p>
{/if}
<script>
// ... other imports
const placeholder = 'Search...';
const language = 'en-GB';
const region = 'GB';
const autocompete = 'off';
</script>
<PlaceAutocomplete {onError} {onResponse} {PUBLIC_GOOGLE_MAPS_API_KEY} bind:countries {placeholder} {language} {region} {autocomplete}/>
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
FAQs
A lightweight and customizable Svelte component for easy integration of Google Maps Places Autocomplete (New API) in your Svelte/SvelteKit applications. Provides accessible autocomplete suggestions and detailed address retrieval.
The npm package @kreonovo/places-autocomplete-svelte receives a total of 6 weekly downloads. As such, @kreonovo/places-autocomplete-svelte popularity was classified as not popular.
We found that @kreonovo/places-autocomplete-svelte demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.