Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers the PreviewUrlModifier extension point in Website Builder. Use when a user wants to inject custom query parameters into live preview URLs — e.g. signed tokens, tenant identifiers, feature flags — from their Webiny project. Handles the full registration pattern: implementing the interface, wiring via createFeature + RegisterFeature, and registering via webiny.config.tsx. Supports async modifier methods (e.g. remote token fetch).
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -47% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -22% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -31% | 0% |
PreviewUrlModifier is a DI extension point that lets project developers inject custom query parameters into all Website Builder live preview URLs. Register one implementation; it receives the full URL object and can mutate it however it needs — including async operations like fetching a signed token from a remote API.
Import from webiny/admin/website-builder. The single required method is modify(url: URL): Promise<void> — mutate url.searchParams in place, mark the method async when you need to fetch remote values.
tsimport { PreviewUrlModifier } from "webiny/admin/website-builder"; class MyPreviewUrlModifier implements PreviewUrlModifier.Interface { async modify(url: URL) { url.searchParams.set("my-param", "my-value"); } } export default PreviewUrlModifier.createImplementation({ implementation: MyPreviewUrlModifier, dependencies: [] });
Async example — fetching a signed token:
tsclass SignedTokenModifier implements PreviewUrlModifier.Interface { async modify(url: URL) { const token = await fetch("/api/preview-token").then(r => r.text()); url.searchParams.set("token", token); } } export default PreviewUrlModifier.createImplementation({ implementation: SignedTokenModifier, dependencies: [] });
tsx// extensions/previewUrlModifier/index.tsx import React from "react"; import { createFeature, RegisterFeature } from "webiny/admin"; import MyPreviewUrlModifier from "./MyPreviewUrlModifier.js"; const PreviewUrlModifierFeature = createFeature({ name: "MyApp/PreviewUrlModifier", register(container) { container.register(MyPreviewUrlModifier); } }); export default () => <RegisterFeature feature={PreviewUrlModifierFeature} />;
tsx// webiny.config.tsx <Admin.Extension src={"@/extensions/previewUrlModifier/index.tsx"} />
| Surface | Description | | ---------------- | ---------------------------------------------------- | | Editor iframe | The live-editing iframe in the page editor | | Address bar link | The "copy preview link" button in the editor toolbar | | Pages list | Preview icon links in the pages list table |
URL object directly.wb.* collisions. Params prefixed wb. are reserved for internal use.wb-custom-page-types -- registering custom page types via PageType abstractionwb-page-settings -- extending page settings groups and fieldsOther measured skills in the registry, with their headline benchmark lift.