API reference for the getDataProvider function.

Initializes the Data Provider capability.

Under the hood, this function:

  • Gets the dataProvider property from the window.canva object
  • Throws an error if the dataProvider property is not available
  • Provides type-safety when using TypeScript
import { getDataProvider } from "@canva/data-provider";
const dataProvider = getDataProvider();
console.log(dataProvider); // => DataProvider

An object that exposes the following methods: