Skip to content
Skillpedia
Websites & UI (frontend)8.1k · #12580

wb-preview-url-modifier

What it does

This skill shows your AI how to add extra parameters to the preview links of Webiny Website Builder pages. It is for developers who need previews to carry tokens, tenant IDs or flags.

When to use it

  • ✓When preview links must include a signed token or tenant identifier.
  • ✓When you want a feature flag value passed to the live preview URL.
  • ✓When the preview link needs data fetched from another service before it opens.

Skill link

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/website-builder/wb-preview-url-modifier/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/website-builder/wb-preview-url-modifier/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Make every Website Builder preview link include a signed token fetched from our preview service.”

5 new skills a week. 1 minute to read.

How it works

The skill explains how to write a small class that changes the preview address before it opens, then register that class in the project. The class can wait for remote values when needed.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Website Builder: Preview URL Modifier

TL;DR

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.

Implement the Modifier

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.

import { 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:

class 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: []
});

Register the Feature

// 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} />;
// webiny.config.tsx
<Admin.Extension src={"@/extensions/previewUrlModifier/index.tsx"} />

Where It Applies

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

Constraints

  • One modifier per project. Only the first registered implementation is used.
  • Mutate in place. Return value is ignored; mutate the URL object directly.
  • No wb.* collisions. Params prefixed wb. are reserved for internal use.

Related Skills

  • wb-custom-page-types -- registering custom page types via PageType abstraction
  • wb-page-settings -- extending page settings groups and fields
FAQ

Can the change depend on remote data?

Yes. The modifier can be asynchronous, for example to fetch a signed token from an API.

Where is it registered?

It is wired through a feature and added in the project's webiny configuration file.

Does it change the published site?

The skill concerns the live preview links only, not the published site.

Details

Original description by the author

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).

repo: webiny/webiny-js

Popularity

GitHub stars
8.1k
Ranking position
#12580
License
—
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills