본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)8.1k · #12580

wb-preview-url-modifier

하는 일

이 스킬은 Webiny Website Builder 페이지의 미리보기 링크에 추가 매개변수를 넣는 방법을 AI에게 보여 줍니다. 미리보기에 토큰, 테넌트 ID, 플래그를 실어야 하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓미리보기 링크에 서명된 토큰이나 테넌트 식별자를 포함해야 할 때.
  • ✓실시간 미리보기 URL에 기능 플래그 값을 넘기고 싶을 때.
  • ✓미리보기 링크를 열기 전에 다른 서비스에서 데이터를 가져와야 하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“모든 Website Builder 미리보기 링크에 미리보기 서비스에서 가져온 서명된 토큰이 들어가도록 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 열리기 전에 미리보기 주소를 바꾸는 작은 클래스를 작성하고, 프로젝트에 그 클래스를 등록하는 방법을 설명합니다. 필요하면 클래스가 원격 값을 기다릴 수도 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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
자주 묻는 질문

변경이 원격 데이터에 의존할 수 있나요?

네. 수정자는 비동기일 수 있어서, 예를 들어 API에서 서명된 토큰을 가져올 수 있습니다.

어디에 등록하나요?

기능을 통해 연결되며, 프로젝트의 webiny 설정 파일에 추가합니다.

게시된 사이트도 바뀌나요?

이 스킬은 실시간 미리보기 링크에만 관련되며, 게시된 사이트는 다루지 않습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
8.1k
순위
#12580
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬