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

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

// Get Current page
const currentPage = await webflow.getCurrentPage() as Page
// Get Open Graph image and print its URL
const openGraphImage = await currentPage.getOpenGraphImage()
if (openGraphImage) {
console.log(openGraphImage)
} else {
console.log('No Open Graph image is set for this page')
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny