npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@canva/intents

v2.4.0

Published

The Canva Apps SDK Intents library

Readme

@canva/intents

A package for Canva's Apps SDK that provides types and utilities for working with App Intents.

Table of contents

Introduction

@canva/intents is an npm package for Canva's Apps SDK. It provides intent-specific types and helpers that allow apps to integrate with specific surfaces within the Canva editor — such as the data connector panel or the design editor.

An "intent" represents a specific user workflow an app can support. For example:

  • Users can select and import data from an app which implements the Data Connector intent.
  • An app is able to present interactive and creative tooling alongside the Canva design surface by implementing the Design Editor intent.
  • Users can publish their Canva designs directly to external platforms.

The @canva/intents package encompasses all available intents, exporting each intent's type information and prepare function, grouped by domain. This allows your app to prepare one or more intents while keeping each intent's implementation modular and type-safe.

Currently supported intents:

New intents will be added to this package in the future.

Note: To get up and running with the Apps SDK, check out the quick start guide.

Installation

npm install @canva/intents

Usage

Preparing an intent

Each intent type has a corresponding prepare function in the @canva/intents package. You can implement any intent in your app code by calling the appropriate prepare function with the particular parameters it requires.

Data Connector example

Here’s a full example of preparing a data_connector intent, which allows users to import tabular data from an app:

import { createRoot } from 'react-dom/client';
import { AppUiProvider } from '@canva/app-ui-kit';
import { prepareDataConnector } from '@canva/intents/data';
import { DataSelectionUI } from './data_selection_ui';
import { fetchData } from './fetch_data';

prepareDataConnector({
  getDataTable: async (request) => {
    try {
      const dataTable = await fetchData(request); // your data fetching logic here
      return {
        status: 'completed',
        dataTable,
      };
    } catch {
      return {
        status: 'app_error',
        message: 'Failed to fetch data',
      };
    }
  },

  renderSelectionUi: (request) => {
    const root = createRoot(document.getElementById('root') as Element);
    root.render(
      <AppUiProvider>
        <DataSelectionUI {...request} />
      </AppUiProvider>
    );
  },
});

Design Editor example

import { prepareDesignEditor } from '@canva/intents/design';

prepareDesignEditor({
  render() {
    // render logic
  },
});

Content Publisher example

import { prepareContentPublisher } from "@canva/intents/content";

prepareContentPublisher({
  renderSettingsUi: ({
    updatePublishSettings,
    registerOnContextChange,
  }) => {
    root.render(
      <AppUiProvider>
        <SettingUi
          updatePublishSettings={updatePublishSettings}
          registerOnContextChange={registerOnContextChange}
        />
      </AppUiProvider>,
    );
  },

  renderPreviewUi: ({ registerOnPreviewChange }) => {
    root.render(
      <AppUiProvider>
        <PreviewUi registerOnPreviewChange={registerOnPreviewChange} />
      </AppUiProvider>,
    );
  },

  getPublishConfiguration: async () => {
    return {
      status: "completed",
      outputTypes: [
        {
          id: "post",
          displayName: "Post",
          mediaSlots: [
            {
              id: "media",
              displayName: "Media",
              fileCount: { exact: 1 },
              accepts: {
                image: {
                  format: "png",
                },
              },
            },
          ],
        },
      ],
    };
  },

  publishContent: async (request: PublishContentRequest) => {
    // logic to upload media to your platform here
    return {
      status: "completed",
      externalId: "1234567890",
      externalUrl: "https://example.com/posts/1234567890",
    };
  },
});

Related packages

The Apps SDK is made up of the following packages:

  • @canva/app-ui-kit - React-based component library for creating apps that mimic the look and feel of Canva.
  • @canva/asset - Provides methods for working with assets, such as image and video files.
  • @canva/design - Provides methods for interacting with the user's design, such as creating elements.
  • @canva/error - Provides a CanvaError class for handling errors.
  • @canva/platform - Provides utility methods, such as a method for opening external links.
  • @canva/user - Provides methods for accessing user data and authenticating users.

Contributing

We're actively developing this package but are not currently accepting third-party contributions. If you'd like to request any changes or additions to the package, submit a feature request via the Canva Developers Community.

License

See the LICENSE.md file.