asset.getAltText()

This method retrieves the Alt Text for a specific Asset.

Syntax

1asset.getAltText(): Promise<string>

Returns

Promise<string>

A Promise that resolves to the Alt Text string.

Example

1// Get Asset by ID
2const asset = await webflow.getAssetById(asset_id)
3console.log(asset)
4
5if (asset) {
6 // Get asset URL
7 const altText = await asset.getAltText()
8 console.log(`Asset Alt Text: ${altText}`)
9}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessAssetsanyanyanyany