Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)25k · #10102

nocobase-app-plugin-notification-web-push

Skill này làm gì

Skill này thêm thông báo Web Push vào ứng dụng NocoBase 3, để người dùng nhận cảnh báo trên trình duyệt và thiết bị của họ. Skill dành cho lập trình viên muốn có thông báo đẩy với đăng ký thiết bị an toàn.

Khi nào nên dùng

  • ✓Khi bạn muốn người dùng nhận cảnh báo đẩy trên trình duyệt từ ứng dụng NocoBase.
  • ✓Khi bạn cần người dùng quản lý tùy chọn đẩy của thiết bị trên trang cài đặt.
  • ✓Khi bạn cần cấu hình HTTPS và khóa VAPID cho web push.

Liên kết skill

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-notification-web-push/skills/nocobase-app-plugin-notification-web-push/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-notification-web-push/skills/nocobase-app-plugin-notification-web-push/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể thiết lập thông báo đẩy trên trình duyệt trong ứng dụng NocoBase của tôi, để người dùng được báo khi một đơn hàng được duyệt không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI đăng ký plugin Web Push, thêm cấu hình của nó và đặt thành phần tùy chọn trên một trang đã đăng nhập. Thông báo sau đó được gửi qua dịch vụ thông báo hiện có tới các thiết bị hoặc người dùng đã chọ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.

Web Push integration

Read this package's README before integration. Register its server plugin after authentication, authorization and notification, and its client factory for localized device preferences. Add pushConfig under push to application default configuration and configure notification.channels.webPush.type as web-push. Mount the exported PushPreferences on an authenticated preferences page and call unsubscribeDevice during sign-out. Provide HTTPS, persistent VAPID and secrets keys, and application-owned installation metadata using pushManifest where installation is needed.

Send title/body/url/dedupeKey with explicit device and user recipients using the existing notification service. URLs include the application's public base path. Business authorization and foreground takeover belong to the application; use the optional named beforeSend hook on every attempt and never put business state into the generic channel. A missing named hook refuses delivery.

The device API is fixed at /api/webPush; browser storage and logout use the framework defaults. defineWebPushPlugin({ title, icon }) accepts application branding, and the worker remains at <publicBasePath>/push-worker.js. Register named afterSubscribe hooks on the service for application initialization after a device is saved; do not mount aliases or customize browser protocols.

Subscriptions accept application language identifiers; untranslated test notifications fall back to English. Renewing an existing subscription preserves its enabled state. Device JSON bodies are strict: listing includes meta.total, PATCH returns the updated device, DELETE returns 204 (404 for missing or unowned devices), and test submission returns 202. Click URLs must be root-relative within the public base path. Message validation rejects the final serialized title/body/url/dedupeKey payload above 3993 UTF-8 bytes before queueing, reserving the aes128gcm encryption overhead within 4096 bytes.

Câu hỏi thường gặp

Có cần HTTPS không?

Có. Skill nói ứng dụng phải được phục vụ qua HTTPS để đẩy thông báo hoạt động.

Ứng dụng có thể kiểm tra quy tắc nghiệp vụ trước khi gửi thông báo đẩy không?

Có. Ứng dụng có thể cung cấp một hook có tên, chạy trước mỗi lần gửi.

Điều gì xảy ra khi đăng xuất?

Skill nói rằng cần hủy đăng ký thiết bị trong lúc đăng xuất.

Chi tiết

Mô tả gốc của tác giả

Integrate encrypted browser push subscriptions and the Web Push notification channel in a NocoBase 3 application.

repo: nocobase/nocobase

Độ phổ biến

Sao GitHub
25k
Vị trí xếp hạng
#10102
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự