fromUrl

API reference for the "fromUrl" method.

Downloads an image from a URL and converts it into a CanvaImageBlob.

Usage

const { imageHelpers } = window.canva;
const canva = window.canva.init();
canva.onReady(async (opts) => {
// Download an image as a CanvaImageBlob
const image = await imageHelpers.fromUrl('URL_GOES_HERE');
// Do something with the result
console.log(image);
});

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>