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.requestClose

API reference for the appProcess.requestClose 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.

Requests the termination of a specific app process.

Usage

import { appProcess } from "@canva/platform";
appProcess.requestClose("ID GOES HERE", { reason: "completed" });
TSX

Parameters

targetstring
REQUIRED

The ID of the app process to close.

paramsobject
REQUIRED

An object that's passed to callbacks registered with the setOnDispose method.

params.reasonstring
REQUIRED

The reason why the app is requesting the process to close.

The possible values are:

  • "completed" - Indicates that a workflow is complete, and any unsaved changes should be saved.
  • "aborted" - Indicates that a workflow has been aborted, and unsaved changes should be ignored.

Returns

Promise<void>