Package Manager (npm)
Address Lookup is also available without transpilation or minification on npm as @addresszen/address-lookup
.
The address-lookup
npm package works out-of-the-box with most bundlers. The advantage of consuming this package are:
- Finer control over which browsers you wish to support
- Dependency deduplification
- Tree shaking
- Smaller package sizes
Install
Add
Add address-lookup to your project via npm with
npm install @addresszen/address-lookup
Instantiate
Instantiate Address Lookup with AddressLookup.setup
.
import { AddressLookup } from "@addresszen/address-lookup";
const controller = AddressLookup.setup({
apiKey: "zenkey",
outputFields: {
line_1: "#line_1",
line_2: "#line_2",
city: "#city",
state: "#state',
zip_plus_4_code: "#zipcode",
},
});