asset.getUrl()

This method retrieves the hosted URL of an asset hosted on Webflow’s CDN.

Syntax

1asset.getUrl(): Promise<string>

Returns

Promise<string>

A Promise that resolves to the URL string of the hosted asset.

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 url = await asset.getUrl()
8 console.log(`Asset URL: ${url}`)
9}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessAssetsanyanyanyany