On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

getDesignMetadata

API reference for the getDesignMetadata method.

Retrieves information about the design.

Usage: Get design metadata

import { getDesignMetadata } from "@canva/design";
const metadata = await getDesignMetadata();
const { title, defaultPageDimensions, pageMetadata, durationInSeconds } = metadata;
TYPESCRIPT

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.

dimensionsPageDimensions
Optional

The dimensions of the page, in pixels.

This may be undefined because some types of pages don't have dimensions, such as whiteboards.

widthnumber

The width of the page, in pixels.

heightnumber

The height of the page, in pixels.

durationInSecondsnumber

The 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.

titlestring
Optional

The title of the user's design.

This is optional and will be undefined if the user hasn't set a title.

defaultPageDimensionsPageDimensions
Optional

The 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).

widthnumber

The width of the page, in pixels.

heightnumber

The height of the page, in pixels.