getCurrentPageContext

API reference for the getCurrentPageContext method.

Gets information about the current page in the user's design.

To see how this method is used, see Positioning elements.

import { getCurrentPageContext } from "@canva/design";
const context = await getCurrentPageContext();
console.log(context);
ts

Before an app that uses this method can be submitted for review, the canva:design:content:read permission must be enabled via the Developer Portal. To learn more, see Configuring permissions.

A Promise that resolves with the following object:

#resultobject
Required

The successful result of getting the current page context.

#result.dimensionsobject
Optional

The dimensions of the page, in pixels.

#result.dimensions.widthnumber
Required

The width of the page, in pixels.

#result.dimensions.heightnumber
Required

The height of the page, in pixels.