API reference for the getDesignInteraction function.

Initializes the Design Interaction capability.

Under the hood, this function:

  • Gets the designInteraction property from the window.canva object
  • Throws an error if the designInteraction property is not available
  • Provides type-safety when using TypeScript
import { getDesignInteraction } from "@canva/design-interaction";
const designInteraction = getDesignInteraction();
console.log(designInteraction); // => DesignInteraction

Returns an object that exposes the following methods: