Skip to content

The embed script

A site that loads the embed script shows the sidebar to its readers, with no extension. annox serves the script at /embed/annox.js.

annox shows annotations on a page once a project covers its URL. Create the project on the Projects page of the webapp; its admin adds the site with the CLI:

Terminal window
annox projects patterns add docs https://docs.example.org/
<meta name="annox-embed">
<script type="module" async src="https://api.annotations.md-systems.ch/embed/annox.js"
data-project="docs"></script>

The script mounts its icon in the element matching [data-annox-region], else in a fixed corner of the window.

The site The readers Attribute
is static have annox accounts none: a click on the icon opens annox’s sign-in in a popup
has its own sign-in are the site’s users data-token-url: the site’s endpoint hands each signed-in user a token
is a public demo are anybody data-token: one token for a demo user, visible to every visitor

A project admin turns the project’s sign-in on (annox projects signin set docs on). The reader clicks the icon, enters the e-mail of their account in the popup and opens the mailed link in the same browser.

  1. The site holds a key pair. Send the public key to the operator of your annox, who registers it for the project.
  2. The site serves a same-origin endpoint that answers its signed-in user with {"token": "…", "expires_in": 600}, a JWT signed with the site’s key.
  3. annox creates the user on first sight and makes them a member of the project.

Make an account for the demo a member of the project, sign in as that account and create a script token limited to the project:

Create a script token

  1. Open Tokens in the webapp.
  2. Under New token, enter a label that names its user, for example ci, and choose Script token: scripts, CI, an MCP client without OAuth.
  3. Pick the project it may reach and its end, 7 or 30 days.
  4. Click Create token and copy the token. annox shows it once.

A script token never reaches wider than your own sign-in and never the platform’s administration. annox tokens revoke <id> or Revoke under Tokens ends it.

Everybody who loads the page holds this token, so the limit to the project and an end matter.

Attribute Meaning
data-project the project’s slug
data-token-url the site’s token endpoint
data-token a static token
data-region where the icon mounts; default [data-annox-region]
data-sidebar="left" the sidebar docks to the left edge; default the right edge
data-header the site’s header the sidebar starts below, such as .totaraNav
data-markers="off" hides the markers on the annotated text
data-selection-add="off" hides the + at a text selection
data-features switches UI units on or off, such as tasks:off triage.priority:on
data-lang the UI’s language: en, de, fr or it; default the page’s <html lang>

annox ships a module per platform that adds the script tag and the token endpoint:

Platform Module
Totara integrations/totara/
Drupal integrations/drupal/
resox documentation sites integrations/resox-docs/

Each module signs a token for the platform’s signed-in user, so its users annotate with their platform account.

<meta name="annox-embed"> tells the extension to stay out of the page. A reader with the extension sees the embed’s sidebar there, and the extension serves every other site of their projects.