Firebase Extensions will shut down on March 31, 2027. You will not be able to install or edit your existing extensions after this date. We recommend moving to self-managed function kits using our user migration guide.Learn more

Validate Address in Firestore

Made by Google Maps Platform

Validates addresses in Firestore using the Address Validation API by Google Maps Platform.

Works with
Cloud Firestore
Version
0.1.3 | Source code
Tags
utilities, shipping, google-maps, location, logistics
License
Apache-2.0
Publisher
Google Maps Platform
Report
Bug
Abuse

No publisher authored function kit replacement for this extension is available. If you want to be able to update this extension after the shutdown on March 31st we recommend you follow our guide for forking the extension and maintaining it yourself as a function kit.

How this extension works

This extension validates and standardizes addresses in your Firestore documents in real-time.

On install, you will be asked to provide a target Firestore collection. When documents are created or updated within that collection, a Cloud Function is trigged that calls the Address Validation API to do the following:

  • Check whether the value at the address field is valid or not, and store the result in the addressValidity field.
  • If the address is valid, standardize the address field (field name is configurable).

For example, the following document:

{
    …,
    address: {
        addressLines: ["1600 Amphitheatre Parkway"],
        regionCode: "US",
        locality: "Mountain View",
    }
}

Will be transformed into the following document:

{
    …,
    address: {
        line1: "1600 Amphitheatre Parkway",
        city: "Mountain View",
        region: "CA",
        postalCode: "94043",
        country: "US"
    },
    addressValidity: true
}

Before installing

Before installing this extension, you must do the following in your Firebase project:

Billing

To install an extension, your project must be on the Blaze (pay as you go) plan.

You will be charged a small amount (typically around $0.01/month) for the Firebase resources required by this extension (even if it is not used).

This extension uses the following Firebase and Google Cloud services which may have associated charges if you exceed the service’s no-cost tier: