Get started

This section describes how to install Kingly. If you encounter any issues, let us know!

You can alternatively leave the installation for later and start with the tutorials. Most of the tutorials can be run and reviewed in code playgrounds, without your having to install the library on your machine. For a more thorough study, we however recommend you to install the library.

Once you are done installing, you can:

Install

Kingly can be installed from npm. The Kingly package provides an ESM build and an UMD build.

NPM

$ npm install kingly

Global <script> Include

It is possible to directly include the library in a script tag in the browser. Kingly will then be registered as a global variable.

For prototyping or learning purposes, you can use the latest version with:

<script src="https://cdn.jsdelivr.net/npm/kingly"></script>

For production, we recommend linking to a specific version number:

<script src="https://cdn.jsdelivr.net/npm/kingly@0.28.0/dist/kingly.umd.min.js"></script>

If you are using native ES Modules, there is also an ES Modules compatible build:

<script type="module">
  import {createStateMachine, makeWebComponentFromFsm, decorateWithEntryActions, traceFSM} from 
  'https://cdn.jsdelivr.net/npm/kingly@0.19.0/dist/kingly.es.min.js'
</script>

AMD

All UMD builds can be used directly as an AMD module.

Browser compatibility

Kingly’s API exposes a makeWebComponentFromFSM function requiring custom-elements V1 support, which is provided by most browsers.

Release Notes

Latest stable version: 0.29

See release notes on GitHub.