Skip to main content

Samples of Workflow Elements

You can find the Samples of Workflow Elements on GitHub:

https://github.com/aurigma/CCHubSample_WorkflowElements

In this repo, you will find several examples that will allow you to try out the API in action:

These examples show how to authenticate in Customer's Canvas Hub, display an editor on a React page, and submit results to the server to start the rendering process.

Technical details

This sample is based on ReactJS as a frontend framework and basic NodeJS Express-based backend.

Getting started

Configuration

Once you clone this repo, you need to configure the .env file. To do this, create a copy of the .env.sample file and add your Customer's Canvas details to the new file.

The environment variables are divided into two groups:

  1. General Customer's Canvas Hub variables: These are available only on the backend.
  2. Frontend-specific variables: These are typically used for certain samples and have the VITE_ prefix.

General variables

The following variables specifies your tenant settings:

Basic Samples-specific variables

For basic code examples, both Simple Editor and Handy Editor, specify:

No-PIM Handy Editor-specific variables

Samples illustrating how to load the Handy Editor without the PIM module require:

  • VITE_NOPIMSAMPLE_CCHUB_PUBLICDESIGNID: A public design ID. You can obtain it through the admin panel (Assets > Designs) as explained at Help Center > Admin's Guide > Assets > File Manager.
  • VITE_NOPIMSAMPLE_CCHUB_EDITORMOCKUPID: A comma-separated list of mockup IDs for the editor. You can obtain the ID through the admin panel Assets > Mockups.
  • VITE_NOPIMSAMPLE_CCHUB_PREVIEWMOCKUPID: A comma-separated list of mockup IDs for the preview. You can obtain the ID through the admin panel Assets > Mockups.

Template Editor-specific variables

For the sample illustrating how to work with the Template Editor, specify:

  • VITE_TEMPLATEEDITOR_CCHUB_PUBLICDESIGNID: A public design ID to open in the Template Editor.

Install and run

Run

npm install

Then

npm run dev

The app will be opened at http://localhost:3000

Was this page helpful?