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

nocobase-app-plugin-notification-in-app

Skill này làm gì

Skill này thiết lập hộp thư thông báo trong ứng dụng NocoBase 3. Mỗi người dùng chỉ thấy thông báo của chính mình, và hộp thư được làm mới trực tiếp. Skill dành cho lập trình viên muốn có hộp thư bên trong ứng dụng.

Khi nào nên dùng

  • ✓Khi bạn muốn người dùng thấy thông báo trong hộp thư bên trong ứng dụng.
  • ✓Khi bạn cần hộp thư tự làm mới ngay sau khi một thông báo được lưu.
  • ✓Khi các mục trong hộp thư bị thiếu hoặc hiện nhầm cho người dùng khác, và bạn cần chẩn đoán.

Liên kết skill

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-notification-in-app/skills/nocobase-app-plugin-notification-in-app/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-in-app/skills/nocobase-app-plugin-notification-in-app/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ể thêm hộp thư thông báo trong ứng dụng NocoBase của tôi, tự làm mới khi một công việc được giao cho người dùng không?”

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

Cách hoạt động

AI đăng ký các mục plugin phía client và phía server, đặt các thành phần hộp thư vào trang do ứng dụng sở hữu, và kết nối topic cập nhật trực tiếp. Thông báo đã lưu vẫn là nguồn chuẩ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.

Goal

Integrate and maintain the authenticated, user-isolated in-app inbox while keeping durable HTTP state authoritative and realtime events limited to invalidation.

Ownership and Placement

This Skill is published with @nocobase/app-plugin-notification-in-app. The plugin owns its Server runtime, persistence, APIs, realtime contract, and Client inbox components. The target application owns whether both Client and Server entries are registered.

Scope

  • Register the Client and Server plugin entries and the core notification dependency.
  • Render the exported inbox components in an application-owned page.
  • Consume the public realtime topic and event types from the /realtime package entry.
  • Verify or diagnose inbox HTTP access, mutations, user isolation, and reconnect refresh.

Non-Goals

  • Do not replace durable notifications with transient browser toasts.
  • Do not edit inbox tables directly or publish forged realtime events as notification state.
  • Do not expect the plugin to contribute an inbox page; the application owns the route.

Input Contract

Input Required Default Validation Clarification Question
action yes verify for existing code; register for a new target register/verify/diagnose "Should I register, verify, or diagnose the inbox?"
application yes infer from one unambiguous workspace application application root with Server and Client configuration "Which application should register the inbox plugin?"
apiConfig no the target application's injected ApiClient and RealtimeClient authenticated client with the intended baseURL/realtimeURL "Should this application use its default or a custom API host?"

Rules:

  • Resolve package versions and enabled plugins from the target application before changing source.
  • Register the package's public /client and /server entries; do not import implementation files.
  • If the target application is ambiguous, stop mutation and ask.

Mandatory Clarification Gate

  • Max clarification rounds: 2.
  • Max questions per round: 3.
  • Read-only inspection and diagnosis may proceed when the application is unambiguous.
  • Missing required input blocks mutation; report the missing contract instead of guessing.

Workflow

  1. Read Inbox Integration Contract for package requirements, public surfaces, and runtime semantics.
  2. Inspect the target application's Server plugin list, Client composition, authentication setup, api.baseURL, api.realtimeURL, and installed package versions.
  3. Register @nocobase/app-plugin-notification before @nocobase/app-plugin-notification-in-app/server when the application needs the in-app Channel contribution.
  4. Register @nocobase/app-plugin-notification-in-app/client in the Client composition root. The plugin contributes no pages: render NotificationInAppInbox inside NotificationInAppProvider in a page the application declares among its own routes.
  5. In React components and custom Hooks, use useApiClient() from @nocobase/app-client for inbox reads and mutations, and useService(realtimeClientToken) for subscriptions. Outside React, resolve the corresponding tokens from the application's services or receive the clients explicitly. Do not reconstruct /api from the browser location or Portal base.
  6. Keep HTTP state authoritative. On a validated inbox.changed event, realtime connection open, or window focus, trigger a bounded HTTP refetch.
  7. Use the public @nocobase/app-plugin-notification-in-app/realtime entry for shared topic or event types; do not import Server internals.
  8. Test allowed and denied users, mutations without a CSRF token, cross-site cookie writes rejected with INVALID_CSRF_ORIGIN, pagination, custom API hosts, realtime invalidation, and reconnect recovery.
  9. Run lint, typecheck, tests, and build for the plugin and affected application.

Reference Loading Map

| Reference

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

Các cập nhật trực tiếp có phải là thông báo thật không?

Không. Sự kiện trực tiếp chỉ là gợi ý, còn hộp thư đã lưu mới là bản ghi chính thức.

Plugin có thêm trang hộp thư không?

Không. Ứng dụng sở hữu route và đặt trang.

Các thông báo nổi tạm thời có thể thay thế hộp thư không?

Không. Skill nói rằng thông báo bền vững không được thay thế bằng toast tạm thời trên trình duyệt.

Chi tiết

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

Use when agents need to register, verify, or diagnose the NocoBase durable in-app inbox, its development-only Client page, or realtime refresh behavior.

repo: nocobase/nocobase

Độ phổ biến

Sao GitHub
25k
Vị trí xếp hạng
#10101
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ự