In the global window object, funnel metadata is available.
π To get the onboardingId, use path:
window.webOnboarding.entity.screensGraph.metadata.onboardingId
In addition to onboardingId, you can also find the following inside window.webOnboarding.entity.screensGraph.metadata:
onboardingNameprojectIdprojectNamewebOnboardingIdwebOnboardingNameand other properties.
This information comes from the server, so it will be accessible anywhere in your code.
The same metadata is also passed into a custom screen under the key:
webOnboarding