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.

appProcess.current.getInfo

API reference for the appProcess.current.getInfo method.
This version of the API is deprecated. This version will soon be unsupported. You should use a stable version of the API in your app.

Gets information about the current process.

Usage

import { appProcess } from "@canva/platform";
const context = appProcess.current.getInfo();
if (context.surface === "object_panel") {
console.log("The process is running in the object panel");
}
TSX

Returns

infoobject
REQUIRED

The information about the current process.

info.surfacestring
REQUIRED

The location in Canva where the process is running.

The possible values are:

  • "object_panel"
  • "selected_image_overlay"
info.processIdstring
REQUIRED

The unique ID of the process.

info.launchParamsobject
OPTIONAL

Arbitrary parameters passed from the app to the process when the process launches.