requestExport

API reference for the requestExport method.

Exports the user's design as one or more static files.

To learn more, see Exporting designs.

import { requestExport } from "@canva/design";
(async () => {
const response = await requestExport({
acceptedFileTypes: ["PNG", "JPG"],
});
if (response.status === "COMPLETED") {
console.log(response); // => { status: "COMPLETED", title: "My design", exportBlobs: [{ url: "https://example.com/image.png" }] }
} else {
console.log("The user exited the export flow.");
console.log(response); // => { status: "ABORTED" }
}
})();

This method has a rate limit of 10 requests every 10 seconds.

#optionsobject
Required

The options for configuring the export of a design.

#options.acceptedFileTypesarray
Required

The types of files the user can export their design as.

A Promise that resolves with the following object:

#resultobject
Required

The result of the successful export of a design.

#result.statusstring
Required

A value that identifies if the export was successful or not.

#result.titlestring
Optional

The title of the design, if it had been set by the user.

#result.exportBlobsarray
Required

The exported files.

#result.exportBlobs[0].urlstring
Required

The URL of the exported file, such as a ZIP or PNG file.