Multi-page document previews are now available in the Content Publisher Intent!

Until now, document previews in content publisher apps were limited to a single thumbnail.

With the latest version of @canva/intents, apps can now request an upgraded preview and receive thumbnails for every page in a document, making it easier to build richer browsing, review, and publishing experiences.

Getting started is as simple as finding document previews that are still in the ‘thumbnail’ status in your preview UI and requesting an upgrade:

useEffect(() => {
  // `PreviewMedia` is provided via the `registerOnPreviewChange` callback
  const unupgradedPreviews = previewMedia
    .flatMap((media) => media.previews)
    .filter((p) => p.kind === "document")
    .filter((p) => p.status === "thumbnail")
    .map((m) => m.id);
  requestPreviewUpgrade(unupgradedPreviews || []);
}, [previewMedia, requestPreviewUpgrade]);

Once requested, we’ll return an upgrading preview followed by a ready preview containing thumbnails for every page in the document.

Docs:

Looking forward to see what you build with it :rocket: