fromUrl
API reference for the "fromUrl" method.
Downloads an image from a URL and converts it into a CanvaImageBlob.

Usage

1
const { imageHelpers } = window.canva;
2
const canva = window.canva.init();
3
4
canva.onReady(async (opts) => {
5
// Download an image as a CanvaImageBlob
6
const image = await imageHelpers.fromUrl("URL_GOES_HERE");
7
8
// Do something with the result
9
console.log(image);
10
});
Copied!

Parameters

Name
Type
Required
Description
url
string
Yes
The URL of an image. This URL must be from a supported Canva domain, such as the domain where assets are hosted.

Returns

Promise<CanvaImageBlob>
Last modified 1mo ago
Copy link