API reference for the getAuthentication function.

Initializes the Authentication capability.

Under the hood, this function:

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

Returns an object that exposes the following methods: