Extension overview
Last updated: 2026-06-18
Use this page when you want to extend schema-dsl but are not sure whether you need a custom type, a factory, a chain method, a validation keyword, or a plugin manager.
The extension system has several layers. They can be combined, but they solve different jobs.
Which extension should I use?
The three schema authoring layers
Custom extension work is easiest to reason about when you separate these layers:
A single extension definition can expose the first two layers with registerExtension({ literal, factoryName, schema }). A custom chain method is a separate concern because it needs a runtime builder method and TypeScript interface augmentation.
Global and runtime-scoped extensions
Use the global schema-dsl/pure entry when an application has one extension set loaded at startup:
Use schema-dsl/runtime when a framework, plugin host, tenant, test suite, or worker needs isolated extension state:
Recommended reading path
- Read Custom DSL Types if you want reusable literals.
- Read Custom s.xxx() Factories if you want editor-discoverable factories.
- Read Custom Chain Methods if you want new builder methods.
- Read Framework Integration before wiring extensions into a real application or framework.
- Read Plugin Manager (Advanced) only when you need plugin lifecycle and hooks.
Corresponding sample file
Example entry: extensions-overview.ts Note: Shows the custom DSL type, namespace factory, runtime-scoped type, and validation keyword paths side by side.