For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
      • Page information
      • Page settings
        • Get branch ID
        • Get parent page ID
        • List branches
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • page.getBranchId()
  • Syntax
  • Returns
  • Example
  • Designer Ability
Pages & FoldersManaging PagesPage branching

Get branch ID

Was this page helpful?
Previous

Get parent page ID

Next
Built with

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}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny