Skip to content

Manual setup

Use manual setup for frameworks not listed in the supported frameworks, or for custom HTML sites.

Add the following to every page of your docs site:

html
<meta name="axiom-do11y-domain" content="AXIOM_DOMAIN">
<meta name="axiom-do11y-token" content="API_TOKEN">
<meta name="axiom-do11y-dataset" content="DATASET_NAME">
<meta name="axiom-do11y-framework" content="FRAMEWORK">
<script src="https://cdn.jsdelivr.net/npm/@axiomhq/do11y@latest/dist/do11y.min.js"></script>

Replace the meta tag values with your Axiom credentials and your framework name. To pin a specific version, replace latest with a version tag like 1.0.0.

Set FRAMEWORK to one of the supported framework values, or 'custom' to provide your own selectors.

Advanced configuration via CDN

Meta tags only cover the essential settings. To configure any advanced options such as scroll thresholds, tracking toggles, or custom selectors, set window.Do11yConfig in an inline script placed before the CDN script:

html
<script>
window.Do11yConfig = {
  axiomHost: 'us-east-1.aws.edge.axiom.co',
  axiomToken: 'xaat-your-ingest-token',
  axiomDataset: 'do11y',
  framework: 'vitepress',
  scrollThresholds: [25, 50, 75, 100],
  trackFeedback: false,
  sectionVisibleThreshold: 5,
};
</script>
<script src="https://cdn.jsdelivr.net/npm/@axiomhq/do11y@latest/dist/do11y.min.js"></script>

When both are present, meta tags take precedence over window.Do11yConfig, which takes precedence over the defaults.

Option 2: Self-host

If you can't use a CDN, host the script yourself.

  1. Download the latest release from GitHub and extract the zip.
  2. Copy dist/do11y.min.js and examples/do11y-config.example.js to your docs project (for example, scripts/).
  3. Rename do11y-config.example.js to do11y-config.js.
  4. In do11y-config.js, replace the placeholder values with your credentials:
js
window.Do11yConfig = {
  axiomHost: 'AXIOM_DOMAIN',
  axiomToken: 'API_TOKEN',
  axiomDataset: 'DATASET_NAME',
  framework: 'FRAMEWORK',
};
  1. Add both scripts to every page, with the config file loading first:
html
<script src="/path/to/do11y-config.js"></script>
<script src="/path/to/do11y.min.js"></script>

Don't edit do11y.min.js directly. It's a build artifact and updating to a new release overwrites it.

Automatic sync via GitHub Action

If you self-host in a GitHub repo, the included examples/sync-do11y-to-docs.yml Action keeps your copy up to date automatically. It runs every Monday and opens a PR when a new release is available.

  1. Copy examples/sync-do11y-to-docs.yml to .github/workflows/ in your docs repo.
  2. Create an empty file at do11y.version to track the installed version.
  3. Add two repository variables under Settings > Secrets and variables > Actions > Variables:
VariableExampleDescription
DO11Y_JS_PATHscripts/do11y.min.jsPath to do11y.min.js in your docs repo.
DO11Y_VER_PATHscripts/do11y.versionPath to the version tracking file.
  1. Go to Settings > Actions > General > Workflow permissions and enable Allow GitHub Actions to create and approve pull requests.

No secrets needed.

Released under the MIT License.