# Configure

Address Lookup exports a [`setup`](https://address-finder.ideal-postcodes.co.uk/modules/setup.html) method to apply address verification to a form. [`setup`](https://address-finder.ideal-postcodes.co.uk/modules/setup.html) requires the following configuration at minimum.

## API Key[​](#api-key "Direct link to API Key")

[`apiKey`](https://address-finder.ideal-postcodes.co.uk/interfaces/controller.controlleroptions.html#apikey)

API Key from your AddressZen account. Typically begins `ak_`

## Address Targets[​](#address-targets "Direct link to Address Targets")

[`outputFields`](https://address-finder.ideal-postcodes.co.uk/interfaces/controller.controlleroptions.html#outputfields)

Specify where to send address data given a selected address. `outputFields` is an object which maps an address attribute to an input field. The input field can be identified by CSS or reference to the DOM element itself.

```
{

  line_1: "#line_1",

  line_2: "#line_2",

  city: document.getElementById("city"),

  state: document.getElementById("state"),

  zip_plus_4_code: document.getElementById("zip_code")

}
```

Assigning up to 2 address lines, city, state and zip code fields, is all addressing information required to identify a US premise. You may extract more data for an address by passing more properties into the `outputFields` configuration object.

The configuration attributes for `outputFields` match the Address response object.

More complex, dynamic assignment can be performed using the [`onAddressRetrieved`](https://address-finder.ideal-postcodes.co.uk/interfaces/controller.controlleroptions.html#onaddressretrieved) callback.

Output fields assigned with a query selector are evaluated lazily (i.e. when an address attribute needs to be piped to a field).
