appProcess.requestClose

API reference for the appProcess.requestClose method.

Requests the termination of a specific app process.

import { appProcess } from "@canva/preview/platform";
appProcess.requestClose("ID GOES HERE", { reason: "completed " });
tsx
#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.

Promise<void>