Get Open Graph image

page.getOpenGraphImage()

Retrieves the URL for the Open Graph image of the page.

This method always returns the image for the primary locale.

Syntax

1page.getOpenGraphImage(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string containing the URL for the Open Graph image of the page or null if there is no image set for the page.

Example

1// Get Current page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Get Open Graph image and print its URL
5const openGraphImage = await currentPage.getOpenGraphImage()
6if (openGraphImage) {
7 console.log(openGraphImage)
8} else {
9 console.log('No Open Graph image is set for this page')
10}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny