Gets the URL of an asset, such as an image or video file, from Canva's backend.
To see how this method is used, see Replacing elements.
Usage
import { getTemporaryUrl } from "@canva/asset";const result = await getTemporaryUrl({type: "IMAGE",ref: "<REFERENCE_GOES_HERE>",});console.log(result.url);
ts
Permissions
Before an app that uses this method can be submitted for review, the canva:asset:private:read
permission must be enabled via the Developer Portal. To learn more, see Configuring permissions.
Rate limit
This method has a rate limit of 20 requests every 10 seconds.
Parameters
Required
The options for getting the URL of an asset.
Required
The type of asset.
The available options include:
"IMAGE"
"VIDEO"
Required
A unique identifier that points to an asset in Canva's backend.
Returns
A Promise
that resolves with the following object: