About Published Site URLs
The Published Site URLs API allows you to retrieve links to the published site.
On occasion, your app might want to direct a site contributor or site visitor to the published site -
for example, to the site's homepage in Spanish.
Terminology
- Published site: A Wix site that is live and visible to site visitors.
- Premium: Wix site builders can pay for Premium plans to unlock additional site tools and features, including connecting their own domains. Read more about Premium plans.
- Primary URL: Site builders can connect an unlimited number of domains (URLs) to a single Wix site. The primary URL is the domain that they connect directly to the site and is the site's main URL.
- Secondary URL: When site builders connect additional domains/URLs to a site, they are considered secondary URLs, and will redirect visitors to the primary URL.
- Wix Multilingual: A Wix product that manages site translation. Read more about Wix Multilingual.
Was this helpful?
Yes
No
Setup
To use the Site API, install the @wix/urls
package using npm or Yarn:
Copy
1npm install @wix/urls
or
Copy
1yarn add @wix/urls
Then import { site }
from @wix/urls
:
Copy
1import { site } from '@wix/urls'
Was this helpful?
Yes
No
listPublishedSiteUrls( )
Developer Preview
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of a site's published URLs. If a site hasn't been published, the call returns an empty array.
Permission Scopes
For app development, you must have one of the following permission scopes:Learn more about permission scopes.
Copy
function listPublishedSiteUrls(options: ListPublishedSiteUrlsOptions): Promise<ListPublishedSiteUrlsResponse>
Method Parameters
optionsListPublishedSiteUrlsOptions
Returns
Return Type:Promise<ListPublishedSiteUrlsResponse>
Was this helpful?
Yes
No