AddressConfig

interface AddressConfig { defaultCountry?: string; showCountries?: string[]; dontShowStates?: string[]; countries?: { code: string; name: string }[]; enableAutocomplete?: boolean; }

Source: global.ts:1271

How the checkout address form behaves — default country, which countries and states to show, and whether to autocomplete. All fields are optional; sensible defaults are derived from the campaign's shipping countries.


Properties

defaultCountry: string

Fallback country when detected country is not available (Low priority fallback).

Automatic fallback priority:

  1. United States (US) - if available in shipping countries
  2. First country in available list - if US not available
  3. This defaultCountry - only if list is empty (edge case)

Default: ```ts undefined (auto-fallback to US or first available country) ```

Example

CODE
"US"

showCountries: string[]

deprecated
global.ts:1291

Use campaign API's available_shipping_countries instead. Countries are now automatically filtered based on your campaign configuration. This field is kept for backward compatibility only (Priority 3 fallback).

Example

CODE
["US", "CA", "GB"]

dontShowStates: string[]

Array of state/province codes to hide from dropdowns (e.g., US territories).

Example

CODE
["AS", "GU", "PR", "VI"]

countries: { code: string; name: string }[]

Custom countries list with full control over code and name. Takes priority over showCountries but not over campaign API countries.

Example

CODE
[{ code: "US", name: "United States" }]

enableAutocomplete: boolean