Get branch ID

page.getBranchId()

Get the branch ID of the current page, or null if the page is not a branch.

Syntax

1page.getBranchId(): Promise<string | null>

Returns

Promise<string | null>

A Promise that resolves to the branch ID as a string when the page is a branch, or null when the page is not a branch.

Example

1const currentPage = await webflow.getCurrentPage()
2
3const branchId = await currentPage.getBranchId()
4if (branchId) {
5 console.log('Currently on branch:', branchId)
6} else {
7 console.log('This page is not a branch.')
8}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny