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.

getCurrentPageContext

API reference for the getCurrentPageContext method.
This version of the API is in beta. Beta APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Allows to get the context of currently selected page.

Returns

Page context of currently selected page. This is a Promise that resolves with the following object:

dimensionsPageDimensions | undefined

The dimensions of the page, in pixels.

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

Properties of dimensions
widthnumber

The width of the page, in pixels.

heightnumber

The height of the page, in pixels.