Skip to content

Configuration

Set all options via window.Do11yConfig using an inline script or a separate config file, or via meta tags. When both are present, meta tags take precedence over window.Do11yConfig, which takes precedence over the defaults.

Axiom connection

OptionDefaultDescription
axiomHost'AXIOM_DOMAIN'Base domain of your Axiom edge deployment. See Edge deployments.
axiomDataset'DATASET_NAME'Name of the Axiom dataset to store your data.
axiomToken'API_TOKEN'Ingest-only API token scoped to the dataset.

Behavior

OptionDefaultDescription
debugfalseLog events to the browser console.
flushInterval5000Milliseconds between batch flushes.
maxBatchSize10Events queued before forcing a flush.
trackOutboundLinkstrueTrack clicks on external links.
trackInternalLinkstrueTrack clicks on internal links.
trackScrollDepthtrueTrack scroll depth thresholds.
scrollThresholds[25, 50, 75, 90]Scroll percentages to record.
trackSectionVisibilitytrueTrack which headings users actually read (via IntersectionObserver).
sectionVisibleThreshold3Minimum seconds a section must be visible before recording.
trackTabSwitchestrueTrack code language/framework tab switches.
trackTocClickstrueTrack on-page table of contents clicks.
trackExpandCollapsetrueTrack expand/collapse interactions (details, accordions).
trackFeedbacktrueTrack "Was this helpful?" feedback widget clicks.
allowedDomains['ALLOWED_DOMAINS']Restrict which domains may send data. Set to null to allow any.
respectDNTtrueHonor the browser's Do Not Track setting.
maxRetries2Retry count for failed requests.
retryDelay1000Base delay between retries in milliseconds (doubles each attempt).
rateLimitMs100Minimum gap between events of the same type.

Framework

Set framework to auto-configure CSS selectors for your documentation platform:

ValueFramework
'mintlify'Mintlify (default)
'docusaurus'Docusaurus
'nextra'Nextra
'mkdocs-material'MkDocs Material
'vitepress'VitePress
'custom'Provide your own selectors (see below)

When you set framework to a supported value, Do11y automatically configures the correct CSS selectors for search bars, copy buttons, code blocks, navigation, footers, and content areas.

You can also set the framework via a meta tag:

html
<meta name="axiom-do11y-framework" content="docusaurus">

Custom selectors

Set framework: 'custom' and provide any combination of the selectors below. Any selector left null falls back to the Mintlify default.

SelectorWhat it targets
searchSelectorSearch trigger elements (input, button).
copyButtonSelector"Copy code" buttons inside code blocks.
codeBlockSelectorCode block containers (<pre>, wrappers).
navigationSelectorNavigation and sidebar regions.
footerSelectorPage footer.
contentSelectorMain content area.
tabContainerSelectorTab groups for code language/framework switching.
tocSelectorOn-page table of contents container.
feedbackSelector"Was this helpful?" feedback widget container.

Example:

js
window.Do11yConfig = {
  axiomHost: 'us-east-1.aws.edge.axiom.co',
  axiomToken: 'xaat-your-ingest-token',
  axiomDataset: 'do11y',
  framework: 'custom',
  searchSelector: '#search-input',
  copyButtonSelector: '.copy-btn',
  codeBlockSelector: 'pre code',
  contentSelector: 'article.content',
  tocSelector: 'nav.toc',
  feedbackSelector: null,
};

Released under the MIT License.