Get the current page

webflow.getCurrentPage()

Retrieves the current page open in the Designer.

Syntax

1webflow.getCurrentPage(): Promise<Page>

Returns

Promise<Page>

A Promise that resolves to the current page.

Example

1// Get Current Page
2const currentPage = await webflow.getCurrentPage()
3const pageName = await currentPage?.getName()
4
5// Print page details
6console.log(currentPage, pageName)

Branch pages

The returned page might be a branch. Use page.getBranchId() to check whether the current page is a branch, and page.getParentPageId() to get the source page ID.

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny