Search.../

getAddress( )

Gets the physical address of the site's business.

Description

The getAddress() function returns a Promise that resolves to the site's corresponding physical address information.

The retrieved address is the address that has been entered in the General Info section of your site's Dashboard.

Syntax

function getAddress(): GeneralInfoAddress

getAddress Parameters

This function does not take any parameters.

Returns

Fulfilled - An object containing the site's corresponding physical address information. Rejected - Error message.

Return Type:

Promise<GeneralInfoAddress>
NAME
TYPE
DESCRIPTION
street
string

Address street.

city
string

Address city.

country
string

Address country.

state
string

Address state.

zip
string

Address zip code.

hint
GeneralInfoAddressHint

Address description.

isPhysical
boolean

Whether the business has a physical address.

googleFormattedAddress
string

Address as formatted by Google.

streetNumber
string

Address street number.

apartmentNumber
string

Address apartment number.

coordinates
GeneralInfoAddressCoordinates

Address coordinates.

Was this helpful?

Get site's corresponding physical address information

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixSiteBackend from 'wix-site-backend';
3
4export const getAddress = webMethod(Permissions.Anyone, () => {
5 return wixSiteBackend.generalInfo.getAddress();
6});
7
8/*
9 * {
10 * "street": "235 W 23rd St",
11 * "city": "New York",
12 * "country": "USA",
13 * "state": "NY",
14 * "zip": "10011",
15 * "hint": {
16 * "text": "green building",
17 * "placement": "BEFORE"
18 * },
19 * "isPhysical": true,
20 * "googleFormattedAddress": "235 W 23rd St, New York, NY, 10011",
21 * "streetNumber": "235",
22 * "apartmentNumber": "12",
23 * "coordinates": {
24 * "latitude": "40.744869",
25 * "longitude": "-73.996736"
26 * }
27 * }
28 */