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,
});
| Option | Type | Default | Description |
|---|---|---|---|
include | RegExp | /\.(jsx|tsx|vue)$/i | File pattern to transform. Only matching files get data-ds attributes injected. |
exclude | RegExp | /node_modules|\.test\.|\.spec\./i | File pattern to exclude from transformation. |
debug | boolean | false | Enable debug logging for the transform pipeline. |
rootDir | string | Vite's config.root | Override root directory for .domscribe/ artifacts. Needed when Vite root differs from project root (e.g., Nuxt with a custom srcDir). |
relay | RelayPluginOptions | See below | Relay server configuration. |
overlay | boolean | OverlayPluginOptions | true | Overlay 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,
});
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true in dev, false in production | Enable or disable the plugin entirely. |
debug | boolean | false | Enable debug logging. |
relay | RelayPluginOptions | See below | Relay server configuration. |
overlay | boolean | OverlayPluginOptions | true | Overlay 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:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable transformation |
debug | boolean | false | Enable 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,
},
}],
},
},
},
}
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable transformation. |
debug | boolean | false | Enable debug logging. |
relay | RelayPluginOptions | See below | Relay server configuration. |
overlay | boolean | OverlayPluginOptions | false | Overlay UI configuration. Defaults to false unlike Vite/Webpack -- overlay injection is handled by the meta-framework wrapper. |
autoInitPath | string | undefined | Absolute 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;
}
| Option | Type | Default | Description |
|---|---|---|---|
autoStart | boolean | true | Automatically start the relay daemon if it is not already running. |
port | number | 0 (dynamic) | Relay server port. When 0, the OS assigns an available port. |
host | string | '127.0.0.1' | Relay server host. Only used when starting a new daemon. |
bodyLimit | number | 10485760 (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;
}
| Option | Type | Default | Description |
|---|---|---|---|
initialMode | 'collapsed' | 'expanded' | 'collapsed' | Initial display mode for the overlay when it loads. |
debug | boolean | false | Enable 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[];
}
| Option | Type | Default | Description |
|---|---|---|---|
phase | 1 | 2 | 1 | Feature phase gate. Phase 1: props and state capture. Phase 2: events and performance. |
redactPII | boolean | true | Redact sensitive values (emails, tokens, patterns) in captured data before transmission. |
blockSelectors | string[] | [] | 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>>;
}
| Option | Type | Default | Description |
|---|---|---|---|
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. |
maxTreeDepth | number | 50 | Maximum component tree depth to traverse when walking the fiber tree. |
includeWrappers | boolean | true | Include HOC, memo, and forwardRef wrapper components in the captured component tree. |
hookNameResolvers | Record<string, Record<number, string>> | undefined | Map 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;
}
| Option | Type | Default | Description |
|---|---|---|---|
maxTreeDepth | number | 50 | Maximum 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:
- Applies the transform plugin in dev mode only
- Injects relay globals and overlay scripts via HTML
- Aliases
@domscribe/overlayto a no-op stub in production (zero bundle impact) - Supports both Webpack (Next.js 15) and Turbopack (Next.js 16+)
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:
- Starts the relay daemon in dev mode
- Injects relay globals via
app.head - Applies Vite and Webpack plugins for AST injection
- Registers a client-only runtime plugin for RuntimeManager and VueAdapter initialization