webflow.getSiteInfo()

Get metadata about the current site.

Syntax

1webflow.getSiteInfo(): Promise<{
2 siteId: string;
3 siteName: string;
4 shortName: string;
5 isPasswordProtected: boolean;
6 isPrivateStaging: boolean;
7 domains: Array<{
8 url: string;
9 lastPublished: string | null;
10 default: boolean;
11 stage: "staging" | "production";
12 }>;
13}>

Returns

A Promise that resolves to a record containing information about the site that is currently open in the Designer - with the following properties

PropertyTypeDescription
siteIdstringThe unique ID of the current Webflow site.
siteNamestringThe name of the current Webflow site.
shortNamestringThe short name of the current Webflow site.
isPasswordProtectedbooleanWhether the current site is password protected.
isPrivateStagingbooleanWhether the current site is private staging.
domainsArray<{url: string, lastPublished: string | null, default: boolean, stage: "staging" | "production"}>An array of objects containing information about the domains associated with the current site.

Example

1const siteInfo = await webflow.getSiteInfo();
2
3console.log('Site ID:', siteInfo.siteId);
4console.log('Site Name:', siteInfo.siteName);
5console.log('Short Name:', siteInfo.shortName);
6console.log('Is Password Protected:', siteInfo.isPasswordProtected);
7console.log('Is Private Staging:', siteInfo.isPrivateStaging);
8console.log('Domains:', siteInfo.domains);
Built with