Configuration Reference

Complete reference for all Domscribe plugin configuration options. Options are organized by category and apply across bundler plugins and framework adapters.


Transform Plugin Options

These are the base options shared across all bundler plugins (@domscribe/transform). Framework adapters (@domscribe/react, @domscribe/vue, @domscribe/next, @domscribe/nuxt) extend these with framework-specific options.

Vite Plugin

import { domscribe } from '@domscribe/transform/plugins/vite';

domscribe({
  include: /\.(jsx|tsx|vue)$/i,
  exclude: /node_modules|\.test\.|\.spec\./i,
  debug: false,
  rootDir: undefined,
  relay: { autoStart: true, port: 0, host: '127.0.0.1', bodyLimit: 10485760 },
  overlay: true,
});
OptionTypeDefaultDescription
includeRegExp/\.(jsx|tsx|vue)$/iFile pattern to transform. Only matching files get data-ds attributes injected.
excludeRegExp/node_modules|\.test\.|\.spec\./iFile pattern to exclude from transformation.
debugbooleanfalseEnable debug logging for the transform pipeline.
rootDirstringVite's config.rootOverride root directory for .domscribe/ artifacts. Needed when Vite root differs from project root (e.g., Nuxt with a custom srcDir).
relayRelayPluginOptionsSee belowRelay server configuration.
overlayboolean | OverlayPluginOptionstrueOverlay UI configuration. Pass false to disable, true for defaults, or an object for fine-grained control.

Webpack Plugin

import { DomscribeWebpackPlugin } from '@domscribe/transform/plugins/webpack';

new DomscribeWebpackPlugin({
  enabled: true,
  debug: false,
  relay: { autoStart: true, port: 0, host: '127.0.0.1' },
  overlay: true,
});
OptionTypeDefaultDescription
enabledbooleantrue in dev, false in productionEnable or disable the plugin entirely.
debugbooleanfalseEnable debug logging.
relayRelayPluginOptionsSee belowRelay server configuration.
overlayboolean | OverlayPluginOptionstrueOverlay UI configuration.

Webpack Loader Options

The webpack loader is managed internally by DomscribeWebpackPlugin. If you need to configure it directly via @domscribe/transform/webpack-loader:

OptionTypeDefaultDescription
enabledbooleantrueEnable transformation
debugbooleanfalseEnable debug logging

Turbopack Loader

Turbopack does not have a plugin system, so the loader is self-initializing -- it manages relay lifecycle and overlay injection directly.

// next.config.ts (turbopack)
{
  turbopack: {
    rules: {
      '*.{tsx,jsx}': {
        loaders: [{
          loader: '@domscribe/transform/turbopack-loader',
          options: {
            enabled: true,
            debug: false,
            relay: { autoStart: true, port: 0, host: '127.0.0.1' },
            overlay: false,
            autoInitPath: undefined,
          },
        }],
      },
    },
  },
}
OptionTypeDefaultDescription
enabledbooleantrueEnable transformation.
debugbooleanfalseEnable debug logging.
relayRelayPluginOptionsSee belowRelay server configuration.
overlayboolean | OverlayPluginOptionsfalseOverlay UI configuration. Defaults to false unlike Vite/Webpack -- overlay injection is handled by the meta-framework wrapper.
autoInitPathstringundefinedAbsolute path to the auto-init module. Used in pnpm monorepos where transformed files do not directly depend on the auto-init package.

Relay Options

Control the relay daemon that bridges the browser overlay and coding agents. These options are passed via the relay field on any bundler plugin.

interface RelayPluginOptions {
  autoStart?: boolean;
  port?: number;
  host?: string;
  bodyLimit?: number;
}
OptionTypeDefaultDescription
autoStartbooleantrueAutomatically start the relay daemon if it is not already running.
portnumber0 (dynamic)Relay server port. When 0, the OS assigns an available port.
hoststring'127.0.0.1'Relay server host. Only used when starting a new daemon.
bodyLimitnumber10485760 (10MB)Maximum request body size in bytes. Only used when starting a new daemon.

Overlay Options

Control the in-browser overlay UI. Pass true for defaults, false to disable, or an object for fine-grained control.

interface OverlayPluginOptions {
  initialMode?: 'collapsed' | 'expanded';
  debug?: boolean;
}
OptionTypeDefaultDescription
initialMode'collapsed' | 'expanded''collapsed'Initial display mode for the overlay when it loads.
debugbooleanfalseEnable debug logging in the overlay components.

Runtime Options

Control the browser-side context capture system. These options are passed via the runtime field on framework adapter plugins.

interface DomscribeRuntimeOptions {
  phase?: 1 | 2;
  redactPII?: boolean;
  blockSelectors?: string[];
}
OptionTypeDefaultDescription
phase1 | 21Feature phase gate. Phase 1: props and state capture. Phase 2: events and performance.
redactPIIbooleantrueRedact sensitive values (emails, tokens, patterns) in captured data before transmission.
blockSelectorsstring[][]CSS selectors for elements to exclude from capture entirely.

React-Specific Options

The @domscribe/react adapter extends the base transform options with React-specific capture settings.

import { domscribe } from '@domscribe/react/vite';

domscribe({
  // ...base transform options (include, exclude, debug, relay, overlay)
  runtime: { phase: 1, redactPII: true, blockSelectors: [] },
  capture: {
    strategy: 'best-effort',
    maxTreeDepth: 50,
    includeWrappers: true,
    hookNameResolvers: undefined,
  },
});
interface DomscribeReactCaptureOptions {
  strategy?: 'devtools' | 'fiber' | 'best-effort';
  maxTreeDepth?: number;
  includeWrappers?: boolean;
  hookNameResolvers?: Record<string, Record<number, string>>;
}
OptionTypeDefaultDescription
strategy'devtools' | 'fiber' | 'best-effort''best-effort'Capture strategy. devtools uses the React DevTools hook (most reliable, requires DevTools installed). fiber accesses the Fiber tree directly (fast). best-effort tries multiple strategies.
maxTreeDepthnumber50Maximum component tree depth to traverse when walking the fiber tree.
includeWrappersbooleantrueInclude HOC, memo, and forwardRef wrapper components in the captured component tree.
hookNameResolversRecord<string, Record<number, string>>undefinedMap component names to hook index to semantic name mappings. Converts generic hook_0, hook_1 names to meaningful labels in captured state.

hookNameResolvers Example

By default, React hook state is captured with generic names like hook_0, hook_1. Use hookNameResolvers to give them meaningful names:

domscribe({
  capture: {
    hookNameResolvers: {
      Button: { 0: 'isHovered', 1: 'variant' },
      SearchInput: { 0: 'query', 1: 'results', 2: 'isLoading' },
    },
  },
});

This maps by component name. Keys are component names, values are objects mapping hook index (0-based) to the semantic name.


Vue-Specific Options

The @domscribe/vue adapter extends the base transform options with Vue-specific capture settings.

import { domscribe } from '@domscribe/vue/vite';

domscribe({
  // ...base transform options (include, exclude, debug, relay, overlay)
  runtime: { phase: 1, redactPII: true, blockSelectors: [] },
  capture: {
    maxTreeDepth: 50,
  },
});
interface DomscribeVueCaptureOptions {
  maxTreeDepth?: number;
}
OptionTypeDefaultDescription
maxTreeDepthnumber50Maximum component tree depth to traverse via VNode hierarchy.

Next.js Options

The @domscribe/next package provides a withDomscribe() config wrapper for Next.js 15 and 16.

import { withDomscribe } from '@domscribe/next';

export default withDomscribe({
  enabled: true,
  include: ['src/**'],
  exclude: ['**/*.test.*'],
  debug: false,
  relay: { autoStart: true, port: 0, host: '127.0.0.1' },
  overlay: { enabled: true },
})(nextConfig);
interface DomscribeNextOptions {
  enabled?: boolean;
  include?: string[];
  exclude?: string[];
  debug?: boolean;
  relay?: { autoStart?: boolean; port?: number; host?: string };
  overlay?: { enabled?: boolean; options?: OverlayPluginOptions };
}

withDomscribe() automatically:


Nuxt Options

The @domscribe/nuxt module provides zero-config integration for Nuxt 3+.

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@domscribe/nuxt'],
  domscribe: {
    debug: false,
    overlay: { enabled: true },
    relay: { autoStart: true, port: 0, host: '127.0.0.1' },
  },
});
interface DomscribeNuxtOptions {
  debug?: boolean;
  overlay?: { enabled?: boolean; options?: OverlayPluginOptions };
  relay?: { autoStart?: boolean; port?: number; host?: string };
}

The Nuxt module automatically: