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.

surfaceAppSurface

The surface on which the app process is running.

Available values:

  • "object_panel"
  • "selected_image_overlay"
  • "headless"
processIdAppProcessId

The unique identifier of the app process.

launchParamsT
Optional

Parameters passed to the app process when it was opened.