Getting started with UI Framework


To download the UI Framework, just run:

npm install @aurigma/ui-framework

The package is already compiled and bundled so there is no need to re-build it.

If you don't want to install it locally, you can use jsdelivr CDN:

Load the editor on a page

Starting with UI Framework 4.0, you should load the editor to the page as follows:

<!DOCTYPE html>
<html lang="en">

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">

  <link rel="stylesheet" href=""
    integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
    .editor-container {
      padding-top: 16px;
      height: 90vh;
  <title>UI Framework Sample</title>

  <div class="container-fluid">
    <div id="editor-container" class="editor-container"></div>

    <script type="module">
      const uiFrameworkBaseUrl = "";
      import moduleLoader from "";
      document.addEventListener('DOMContentLoaded', async () => {

        // See
        // for more details.
        const prodRequest = await fetch('./sample/product.json');
        const product = await prodRequest.json();

        // See for
        // the syntax explanation and widget reference.
        const confRequest = await fetch('./sample/config.json')
        const config = await confRequest.json();

        let driver = (await moduleLoader.dynamicImport("ecommerceDriver", `${uiFrameworkBaseUrl}/dist/drivers/default-driver.js`)).ecommerceDriver;
        let editor = (await moduleLoader.dynamicImportDefault("editor", `${uiFrameworkBaseUrl}/dist/editor.js`)).editor;

        // Don't forget to specify actual link to your instance of Customer's Canvas as a value of customersCanvasBaseUrl
        let ecommerce = await driver.init(product, editor, config, /* settings */ { customersCanvasBaseUrl: "" }, /* restore data */ null, /*quantity*/ 1, /* user info*/ { id: 'test-user' });

        // How to receive data from the editor after the user finishes editing it
        ecommerce.cart.onSubmitted.subscribe(function (data) {
          data.lineItems.forEach(function (order) {



A few comments on this:

  1. Create a div element, which will be a container for the editor.
  2. The editor is loaded to the page using the moduleLoader script, which allows for dynamically importing of ES6 modules.
  3. All modules are located by the location you configure with the uiFrameworkBaseUrl variable. Since the import keyword in JavaScript only supports string literals, you have to duplicate the URL there as well.
  4. There are two JSON objects you have to prepare to pass to the editor - the product and the config. In this demo, they are hardcoded. However, in a real-life application, you should either send them from the back end or create them dynamically.
    • The product contains a definition of the product from the e-commerce system. See the Working With E-commerce Driver article for details.
    • The config describes the user interface and the behavior of the editor. This sample illustrates the simplest possible config that has no real useful function, but keeps the explanation brief. See the Introduction to UI Framework and other documentation articles to learn how to create more useful configs.
  5. You should load a couple of UI Framework modules (an e-commerce driver and the editor) and initialize them using the driver.init(...) method where you pass the product, config, and some other data. After that, you are using the renderEditor method where you pass the container element you created in Step 1.
  6. To get the information from the editor when the user finishes editing, you can subscribe to the onSubmitted event handler. Other events also exist.