Skip to content

Configuration

This page documents all configuration options for Do11y except for destination options. See Destinations and setup paths for more information on destinations.

Set options

The way you set options for Do11y depends on which setup path you use:

Standalone path

Set options using one of the following methods:

Meta tagsConfiguration object
ScopeLimited set of optionsAll options
Value typesStrings onlyNative JavaScript types
PrecedenceRead last, takes precedence over configuration objectRead first, overridden by a matching meta tag

Meta tags

Create meta tags using the form <meta name="do11y-..." content="..." />.

The following options are supported:

Meta tag nameConfig option
do11y-destinationdestination
do11y-urlsupabaseUrl
do11y-keysupabaseKey
do11y-tablesupabaseTable
do11y-endpointendpoint
do11y-otlp-endpointotelSdkEndpoint
do11y-otlp-headersotelSdkHeaders
do11y-debugdebug
do11y-domainsallowedDomains
do11y-frameworkframework

Configuration object

Create a window.Do11yConfig object from an inline script or a separate config file. For example:

js
window.Do11yConfig = {
  destination: 'http',
  endpoint: 'BACKEND_URL',
  headers: {
    'Authorization': 'Bearer API_TOKEN',
  },
  framework: 'vitepress',
  scrollThresholds: [25, 50, 75, 95],
  respectDNT: false,
};

OpenTelemetry instrumentation path

Pass the configuration as a constructor argument to DocsInstrumentation:

ts
import { DocsInstrumentation } from '@manototh/do11y/instrumentation';

new DocsInstrumentation({
  framework: 'vitepress',
  trackScrollDepth: true,
  trackSectionVisibility: true,
});

The following options from the full configuration are not supported by DocsInstrumentation:

| flushInterval, maxBatchSize | Standalone batch queue. Batching is handled by the OTel SDK batch processor. | | maxRetries, retryDelay | Standalone transport retry. Retries are handled by the OTel exporter/collector. |

Behavior

OptionDefaultDescription
debugfalseLog events to the browser console.
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.
allowedDomainsnullRestrict which domains may send data. Set to null to allow any.
respectDNTtrueHonor the browser's Do Not Track setting.
rateLimitMs100Minimum gap between events of the same type (applies to both the script-tag build and DocsInstrumentation). Distinct scroll depth thresholds are exempt, so a fast scroll still records every milestone.

The following options are only supported in the Standalone setup path. They are ignored when using the OpenTelemetry instrumentation path because batching and retries are handled by the OpenTelemetry SDK.

OptionDefaultDescription
flushInterval5000Milliseconds between batch flushes.
maxBatchSize10Events queued before forcing a flush.
maxRetries2Retry count for failed requests.
retryDelay1000Base delay between retries in milliseconds (doubles each attempt).

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
'starlight'Starlight (Astro)
'docsy'Docsy (Hugo)
'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.

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).
copyButtonSelectorCopy 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.
feedbackSelectorFeedback widget container.

Released under the MIT License.