API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenrequestExportselection.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.
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
Optional
Parameters passed to the app process when it was opened.