getContent

API reference for the getContent function.

Initializes the Content capability.

Under the hood, this function:

  • Gets the content property from the window.canva object
  • Throws an error if the content property is not available
  • Provides type-safety when using TypeScript

Usage

import { getContent } from "@canva/content";
const content = getContent();
console.log(content); // => Content

Returns

Returns an object that exposes the following methods: