/cometchat-skills:cometchat-react-v7-pushfrom cometchat-skills
Adds web push notifications to a React app using CometChat v7 SDK with Firebase Cloud Messaging. Fetches setup from CometChat docs and applies hardening deltas for token lifecycle.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ground truth — DOCS-FIRST. Push is an EXTERNAL integration (Firebase/FCM + a service worker + a Dashboard FCM provider), not a UI Kit component. The full, current setup lives in CometChat's notifications docs — FETCH them, don't bake a recipe here: via
cometchat-react-v7-core/references/docs-map.md→/notifications/push-overview·/notifications/web-push-notifications·/notifications/preferences. This skill is THIN: it points you at those docs as the SOURCE and bakes ONLY the hardening deltas + the exact SDK symbols (verified vs installed@cometchat/chat-sdk-javascript). Symbols are baked; the step-by-step is fetched.
cometchat-react-v7-core — install, credentials, init→login→render. This skill ASSUMES it (push registers AFTER login, on the SAME SDK)."add push notifications", "web push", "notify me on a new message when the app is closed", "FCM push". For a NON-web platform (Android/iOS/RN/Flutter) push differs — that's not this skill.
{DOCS_BASE}/notifications/web-push-notifications.md (+ push-overview.md) via docs-map.md. Follow its Firebase project + FCM setup, the firebase-messaging-sw.js service worker, and the client registration flow. Build FROM the docs; if the docs are wrong/missing a detail, that's a DOCS gap — flag it (RULES §20), don't bake a permanent workaround.npm i firebase@^10.3.1 (the FCM web SDK). CometChatNotifications ships with the already-installed @cometchat/chat-sdk-javascript — no extra CometChat package.import { CometChat, CometChatNotifications } from "@cometchat/chat-sdk-javascript";
// Register AFTER login, with the FCM token you got from firebase getToken():
await CometChatNotifications.registerPushToken(
fcmToken, // string — from firebase messaging getToken({ vapidKey })
CometChatNotifications.PushPlatforms.FCM_WEB, // enum member
providerId // optional — your Dashboard FCM provider id
);
// On logout (before CometChatUIKit.logout()):
await CometChatNotifications.unregisterPushToken();
Signature (installed source):
registerPushToken(pushToken: string, platform: PushPlatforms, providerId?: string)·unregisterPushToken(). Fetch anything beyond these from the notifications docs.
firebase-messaging-sw.js must be served from the ORIGIN ROOT: Vite / CRA → public/firebase-messaging-sw.js (copied to the web root); Next.js → public/firebase-messaging-sw.js (App or Pages router); Astro → public/firebase-messaging-sw.js. A SW under src/ or a hashed asset path will NOT register. HTTPS (or localhost) is required.Notification.requestPermission() from a click/tap (a browser blocks/annoys otherwise). Only call getToken() after permission is granted.registerPushToken(...) AFTER CometChatUIKit.login() resolves; unregisterPushToken() BEFORE CometChatUIKit.logout(). Re-register on token refresh (onTokenRefresh/getToken again). Skipping unregister on logout leaks notifications to the wrong user.unregisterPushToken() on logout → cross-user leakage. · Expecting Safari-tab push on iOS. · No Dashboard FCM provider → nothing delivers even with correct client code.Static verification only: the SDK symbols resolve + the app compiles + the SW registers (check the browser Application → Service Workers). Live delivery is a manual, device-dependent check (real HTTPS origin + a registered SW + the Dashboard FCM provider + granted permission → send a message with the app backgrounded). This is the one skill whose live gate is inherently blocked-external — do NOT claim delivery works from a build alone.
End with the shared 3-option selectable menu and WAIT for the pick — (1) add another feature (suggest a few not-yet-wired) · (2) customize theming · (3) test it manually (stop; let the user check). Same contract as the cometchat-react-v7-core close (RULES.md §19).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'.Other plugins' skills for the same job