🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@directus-labs/address-completion-interface

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@directus-labs/address-completion-interface

Use Google Places autocomplete Data API as an Address Completion interface

1.0.1
latest
npm
Version published
Weekly downloads
20
-25.93%
Maintainers
0
Weekly downloads
 
Created
Source

Address Completion Interface for Directus

A Directus interface that integrates Google Maps address autocompletion functionality into the Directus Editor.

Features

  • Google Maps address autocompletion
  • Customizable autocompletion configuration
  • Display the result on a map (optionally)

Prerequisites

  • A Directus installation
  • Google Maps API key with appropriate permissions
  • Access to your Directus environment variables

Installation

To install the extension, take a look at the Official Guide.

Configuration

1. Environment Variables

Add the following environment variables to your config file, in order to allow the app to load data from the google-APIs:

CONTENT_SECURITY_POLICY_DIRECTIVES__SCRIPT_SRC=array:'self', 'unsafe-eval', https://*.googleapis.com
CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC=array:'self', data:, https://*.gstatic.com, https://*.googleapis.com

2. Google Maps API Setup

  • Obtain a Google Maps API key from the Google Cloud Console. View Google documentation
  • Enable the following APIs in your Google Cloud project:
    • Places API (New)
    • Maps JavaScript API

Recommended Security Measures:

  • Restrict the API key to your domain
  • Enable only the required services (Places API and Maps JavaScript API)

Interface Configuration

Autocomplete Settings

You can customize the autocomplete behavior using the interface settings. The configuration accepts standard Google Places Autocomplete parameters as documented in the Google Maps JavaScript API Reference.

Example Configuration:

{
    "includedRegionCodes": [
        "us"
    ]
}

This example restricts autocomplete results to US addresses only.

Support

For issues and feature requests, please use the GitHub issues section of this repository.

Keywords

directus

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

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