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.
Every site needs a project that covers it
Section titled “Every site needs a project that covers it”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:
annox projects patterns add docs https://docs.example.org/Add the script tag
Section titled “Add the script tag”<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.
Three ways to sign the readers in
Section titled “Three ways to sign the readers in”| 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 |
Sign-in at annox
Section titled “Sign-in at annox”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.
The site’s own sign-in
Section titled “The site’s own sign-in”- The site holds a key pair. Send the public key to the operator of your annox, who registers it for the project.
- 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. - annox creates the user on first sight and makes them a member of the project.
A demo token
Section titled “A demo token”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
- Open Tokens in the webapp.
- Under New token, enter a label that names its user, for example ci, and choose Script token: scripts, CI, an MCP client without OAuth.
- Pick the project it may reach and its end, 7 or 30 days.
- Click Create token and copy the token. annox shows it once.
annox tokens add script --label ci --project <project> --expires 2027-06-30The command prints the token alone, once. Without --project the
token reaches all your projects, without --expires it runs until it
is revoked. annox login signs the CLI in first.
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.
The attributes
Section titled “The attributes”| 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> |
Modules for platforms
Section titled “Modules for platforms”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.
The embed and the extension share a page
Section titled “The embed and the extension share a page”<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.