Digital Asset Management app

Retrieve content from a backend and make it available to a Canva app.

You can build a digital asset management (DAM) app that retrieves content from a backend and makes it available to a Canva app.

To help you get started, Canva has created a template DAM app that you can install and customize, using the @canva/create-app command-line interface (CLI).

This article shows you how to install the example DAM app, run it locally on your machine, and start adding customizations.

This step installs the DAM app and its dependencies in a new directory.

  1. Use the following command to install and run @canva/create-app:

    npx @canva/create-app@latest
    bash
  2. Use the arrow keys to select Digital Asset Management, then press enter.

  3. The installation process guides you through the remaining settings:

    1. Enter your app's name.
    2. Choose whether to initialize a git repository for your project.
    3. Choose whether your project should use npm to install its dependencies.

After the installation process has completed, the output lists the steps for running the new app. For example:

cd example-dam-app
npm start
bash
  • Replace example-dam-app with your app's name.

Create a new Canva app in the Developer Portal. For more information, see Creating apps.

Open the .env file in your project's root directory and add your app's ID to the CANVA_APP_ID setting. To find this value, open Your apps, find the app you created in step 2, and copy the ID from the App ID column.

CANVA_APP_ID=<your App ID>
bash

Run the app locally to see a preview.

  1. Navigate to your app's directory and start the app. The example-dam-app directory name will vary based on your app's name.

    cd example-dam-app
    npm start
    bash
  2. In Your apps, select your app, then Configure your app > App source > Development URL.

  3. In the Development URL field, enter the URL of the Development URL (Frontend).

  4. Click Preview. This opens a new tab in the Canva editor, with your app in the sidebar.

  5. Click Open. This message only appears when using an app for the first time.

The example DAM app should now be running locally. In the preview, you can see tabs called All, Collection, and Assets. This procedure demonstrates how to rename a tab.

  1. In your IDE, open the canva-apps-sdk-starter-kit/examples/digital_asset_management/config.ts file.

  2. In your IDE, open the src/config.ts file and change label: "Folders", to label: "My Folders",

    containerTypes: [
    {
    value: "folder",
    label: "Folders",
    listingSurfaces: [
    { surface: "HOMEPAGE" },
    {
    surface: "CONTAINER",
    parentContainerTypes: ["folder"],
    },
    { surface: "SEARCH" },
    ],
    searchInsideContainer: {
    enabled: true,
    placeholder: "Search for resources inside this folder",
    },
    },
    ],
    typescript
  3. Save the changes to config.ts.

  4. Click to reload the app. The renamed tab should now be visible in the preview.

Screenshot featuring the reload button

To retrieve digital assets, connect the app to your backend. For more information, see Using a backend.

Update your app to add user authentication. You can use frictionless or manual authentication:

  • Frictionless: To implement frictionless authentication, add App ID and JWT verification middleware to your app. This approach uses the auth.getCanvaUserToken() method to receive a JWT. For more information, see JSON Web Tokens. For an example, see the authentication demo in the canva-apps-sdk-starter-kit repository.
  • Manual: Alternatively, you can configure your app for manual authentication with a third-party platform.

Once your app is ready, submit it on the Developer Portal. For more information, see Submitting apps.