Configure behaviour

Configuration Overview

Algebrakit Web Components can be customized through a global AlgebraKIT configuration object. You must include this configuration before the script that loads the main frontend API.

Basic Setup

<script>
  AlgebraKIT = {
    config: {
      // Proxy configuration for API calls
      proxy: {
        url: 'proxy/algebrakit'
      },
      // Optional styling configuration
      styles: {
        ...
      },
      // Optional behavior configuration
      behavior: {
        ...
      }
    }
  };
</script>

<!-- Load after setting configuration -->
<script src="https://widgets.algebrakit.com"></script>

⚠️ Do not use the async attribute when loading akit-widgets.min.js.
⚠️ Never load the widget script more than once on a page.


Configuration Properties

Property Description
proxy Routes API calls through a local proxy for enhanced security. See Set up the proxy.
styles Customize the appearance of the Web Components. See Style the components.
behavior Control interaction behavior. See below.

Behavior Config

You can apply behavior settings globally or per interaction type. Settings under general apply to every component; settings under components apply to one interaction type and override the global value.

AlgebraKIT = {
  config: {
    behavior: {
      general: {
        externalSubmitButton: false,
        reviewModeShowSolution: true
      },
      components: {
        inline: {
          submitOnEnter: true
        }
      }
    }
  }
};

Common things to reach for:

  • Supplying your own buttons? Set externalSubmitButton to hide the built-in submit and hint buttons.
  • Building a review screen? Set reviewModeShowSolution to show correct answers alongside the student's work, and emitEventsOnRehydrate if you need the learning events replayed.
  • Restoring earlier sessions? emitEventsOnRehydrate replays the events that led to the stored state.

Every available property, its type and its default value is listed in the configuration properties reference.