Samples of Workflow Elements
- 2 minutes to read
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:
- General Customer's Canvas Hub variables: These are available only on the backend.
- Frontend-specific variables: These are typically used for certain samples and have the
VITE_
prefix.
General variables
The following variables specifies your tenant settings:
CCHUB_BASEURL
: Depending on your instance, it is eitherhttps://customerscanvashub.com
(US),https://eu.customerscanvashub.com
(Europe), orhttps://au.customerscanvashub.com
(Australia).CCHUB_STOREFRONTID
: A storefront (or integration) record ID, created as per the Help Center > Admin's Guide > Settings > Integrations.CCHUB_CLIENTID
andCCHUB_CLIENTSECRET
: OAuth2 Client Credentials of your app, registered in your tenant as per the Help Center > Admin's Guide > Settings > External Apps.CCHUB_TENANTID
: Specify your tenant ID. See the Help Center > Admin's Guide > Settings > Tenant.VITE_CCHUB_ENVIRONMENT
: The location of your Customer's Canvas instance —us
,eu
, orau
.
Basic Samples-specific variables
For basic code examples, both Simple Editor and Handy Editor, specify:
VITE_BASICSAMPLE_CCHUB_PRODUCTID
: Create a product in Customer's Canvas as per the Help Center > Admin's Guide > PIM Module > Creating products and set its ID here.
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