Skip to main content
The script tag is under active development — as we are in beta, we’ll be making non-breaking (patch) changes often. It’s therefore recommended that you load the script tag with a non-specific version number (the one included in the example).If you need more peace of mind, you can get a specific version from here: https://www.jsdelivr.com/package/npm/@kenobi.ai/js

Script tag

Simply add the following code after the opening <head> tag and **before the closing **</head>tag.

How the script tag works

  1. The script tag loads quickly as your page content is being rendered, and figures out
    1. If a visitor key is present in the URL (e.g. example.com/?kfor=abc123)
    2. Which page path it’s on
  2. If there’s no visitor key, it will gracefully exit early
  3. The script tag contacts the Kenobi API to get any transformations that might exist for the current page path, and then applies (changes elements) these to the page
  4. A listener for when the page path changes is activated in the background, and the visitor key should persist for the current browser tab (only)

Known issues

  • Some navigation actions do not correctly sync with state (multi-page transformations are not rendered reliably)