Get branch ID

page.getBranchId()

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

Syntax

page.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

const currentPage = await webflow.getCurrentPage()
const branchId = await currentPage.getBranchId()
if (branchId) {
console.log('Currently on branch:', branchId)
} else {
console.log('This page is not a branch.')
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny