wb-preview-url-modifier
Skill này làm gì
Skill này cho AI của bạn biết cách thêm tham số bổ sung vào liên kết xem trước của các trang Website Builder trong Webiny. Dành cho lập trình viên cần liên kết xem trước mang token, tenant ID hoặc cờ.
Khi nào nên dùng
- ✓Khi liên kết xem trước phải chứa token có chữ ký hoặc mã tenant.
- ✓Khi bạn muốn giá trị feature flag được truyền vào URL xem trước trực tiếp.
- ✓Khi liên kết xem trước cần dữ liệu lấy từ dịch vụ khác trước khi mở.
Liên kết skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/website-builder/wb-preview-url-modifier/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm mọi liên kết xem trước của Website Builder có chứa token có chữ ký lấy từ dịch vụ xem trước của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giải thích cách viết một class nhỏ thay đổi địa chỉ xem trước trước khi mở, rồi đăng ký class đó trong dự án. Class có thể chờ giá trị từ xa khi cần.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
URLobject directly. - No
wb.*collisions. Params prefixedwb.are reserved for internal use.
Related Skills
wb-custom-page-types-- registering custom page types via PageType abstractionwb-page-settings-- extending page settings groups and fields
Câu hỏi thường gặp
Thay đổi có thể phụ thuộc vào dữ liệu từ xa không?
Có. Modifier có thể bất đồng bộ, ví dụ để lấy token có chữ ký từ một API.
Nó được đăng ký ở đâu?
Nó được nối qua một tính năng và thêm vào file cấu hình webiny của dự án.
Nó có thay đổi trang đã xuất bản không?
Skill chỉ liên quan đến liên kết xem trước trực tiếp, không liên quan đến trang đã xuất bản.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 8.1k
- Vị trí xếp hạng
- #12580
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
prd-to-plan
8.1kGiúp agent của bạn biến tài liệu yêu cầu sản phẩm thành kế hoạch theo giai đoạn gồm các lát cắt đầu-cuối nhỏ, lưu thành file Markdown.
webiny-admin-architect
8.1kDạy agent của bạn cách xây dựng màn hình quản trị cho nền tảng Webiny, dùng các tầng logic nghiệp vụ và mẫu presenter.
webiny-admin-permissions
8.1kDạy agent của bạn thêm kiểm soát quyền vào màn hình quản trị Webiny, gồm form quyền tự sinh và kiểm tra ẩn hoặc hiện.
webiny-form-model
8.1kDạy agent của bạn xây dựng form trong Webiny bằng trình tạo trường khai báo, bố cục, kiểm tra hợp lệ và quy tắc có điều kiện.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.