getDesignMetadata
Retrieves information about the design.
Usage: Get design metadata
import { getDesignMetadata } from "@canva/design";const metadata = await getDesignMetadata();const { title, defaultPageDimensions, pageMetadata, durationInSeconds } = metadata;
Returns
Information about the design. This is a Promise that resolves with the following object:
pageMetadataIterable<PageMetadata>The information associated with each page of the design.
The order of pages is not guaranteed.
dimensionsPageDimensionsThe dimensions of the page, in pixels.
This may be undefined because some types of pages don't have dimensions, such as whiteboards.
widthnumberThe width of the page, in pixels.
heightnumberThe height of the page, in pixels.
durationInSecondsnumberThe duration of the whole design in seconds.
This is the precise value, which differs from what is displayed in the UI as duration in Canva UI is formatted differently.
titlestringThe title of the user's design.
This is optional and will be undefined if the user hasn't set a title.
defaultPageDimensionsPageDimensionsThe default dimensions that a new page will have when it is added to a design. It is possible for a user to resize a page without resizing the entire design, e.g. by clicking "Expand to Whiteboard". However, there will always be a single set of default dimensions for a design that is applied whenever a new page is created.
This is optional and will be undefined if the design is unbounded (e.g. Whiteboard or Doc).
widthnumberThe width of the page, in pixels.
heightnumberThe height of the page, in pixels.