API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignMetadatagetDesignTokeninitAppElementoverlay.registerOnCanOpenopenDesignrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDrag
Intents: data
Intents: design
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrl
appProcess.current.getInfo
API reference for the appProcess.current.getInfo method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Returns information about the current app process.
Usage
Get current process information
import { appProcess } from '@canva/platform';const currentProcess = appProcess.current;const processInfo = currentProcess.getInfo();
TYPESCRIPT
Check current process surface type
import { appProcess } from '@canva/platform';const currentProcess = appProcess.current;const { surface } = currentProcess.getInfo();if (surface === 'object_panel') {// This app is running in the object panel}
TYPESCRIPT
Read current process launch parameters
import { appProcess } from '@canva/platform';type MyLaunchParams ={mode: 'edit' | 'view';id: string;}const currentProcess = appProcess.current;const { launchParams } = currentProcess.getInfo<MyLaunchParams>();if (launchParams) {const { mode, id } = launchParams;// Use launch parameters}
TYPESCRIPT
Returns
Information about an app process.
surface
AppSurface
The surface on which the app process is running.
Available values:
"object_panel"
"selected_image_overlay"
"headless"
processId
AppProcessId
The unique identifier of the app process.
launchParams
T
OptionalParameters passed to the app process when it was opened.