Generate experiences with Puck AI
Read docs
CloudAPI referenceplugin-assetsTypesAssetValue

AssetValue

Puck Assets is in early access. Request access.

The value of an asset field.

{
  "src": "https://www.example.com/cdn/image/format=auto,width=1200/bike.png",
  "originalSrc": "https://www.example.com/bike.png",
  "transform": { "width": 1200 },
  "id": "asset_123",
  "mediaType": "image/png",
  "alt": "A red bike",
  "width": 2400,
  "height": 1600
}

Params

ParamExampleTypeStatus
srcsrc: "https://www.example.com/bike.png"StringRequired
originalSrcoriginalSrc: "https://www.example.com/bike.png"String-
transformtransform: { width: 1200 }Object-
idid: "asset_123"String-
mediaTypemediaType: "image/png"String-
altalt: "A red bike"String-
widthwidth: 2400Number-
heightheight: 1600Number-

src

The URL of the selected asset. Use this to render the asset or fetch it. Includes image transforms if applied.

originalSrc

The URL of the selected asset without its transform.

transform

The transform applied to the asset.

id

The id of the selected asset.

mediaType

The media type of the selected asset.

alt

The alt text of the selected asset. Editable by the user.

width

The width of the selected asset in pixels, if known.

height

The height of the selected asset in pixels, if known.