APIsChangelog
Log In

Get Asset URL

asset.getUrl()

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

Syntax

asset.getUrl(): Promise<string>

Returns

Promise<string>

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

Example

// Get Asset by ID
const asset = await webflow.getAssetById(asset_id)
console.log(asset)

if (asset) {
  // Get asset URL
  const url = await asset.getUrl()
  console.log(`Asset URL: ${url}`)
}