webflow.getSiteInfo()Get metadata about the current site.
1 webflow.getSiteInfo(): Promise<{ 2 siteId: string; 3 siteName: string; 4 shortName: string; 5 isPasswordProtected: boolean; 6 isPrivateStaging: boolean; 7 workspaceId: string; 8 workspaceSlug: string; 9 domains: Array<{ 10 url: string; 11 lastPublished: string | null; 12 default: boolean; 13 stage: "staging" | "production"; 14 }>; 15 }>
A Promise that resolves to a record containing information about the site that’s currently open in the Designer. The record has the following properties:
| Property | Type | Description |
|---|---|---|
siteId | string | The unique ID of the current Webflow site. |
siteName | string | The name of the current Webflow site. |
shortName | string | The short name of the current Webflow site. |
isPasswordProtected | boolean | Whether the current site is password protected. |
isPrivateStaging | boolean | Whether the current site is private staging. |
domains | Array<{url: string, lastPublished: string | null, default: boolean, stage: "staging" | "production"}> | An array of objects containing information about the domains associated with the current site. |
workspaceId | string | The unique ID of the workspace that the current site belongs to. |
workspaceSlug | string | The unique slug of the workspace that the current site belongs to. |
1 const siteInfo = await webflow.getSiteInfo(); 2 3 console.log("Site ID:", siteInfo.siteId); 4 console.log("Site Name:", siteInfo.siteName); 5 console.log("Short Name:", siteInfo.shortName); 6 console.log("Is Password Protected:", siteInfo.isPasswordProtected); 7 console.log("Is Private Staging:", siteInfo.isPrivateStaging); 8 console.log("Domains:", siteInfo.domains); 9 console.log("Workspace ID:", siteInfo.workspaceId); 10 console.log("Workspace Slug:", siteInfo.workspaceSlug);