{"id":"dd31d8f2-36b9-437f-823c-d0862f0b2927","shortId":"9guNtj","kind":"skill","title":"cometchat-react-push","tagline":"Push notifications for CometChat React UI Kit v6 in Vite / Next.js / React Router / Astro projects. Web doesn't have native push — covers Web Push (Service Worker + Push API + Notification API + VAPID keys), CometChat dashboard PushPlatform configuration, server-side webhook to s","description":"## Purpose\n\nWeb Push for CometChat chat. The web has no native VoIP-push equivalent for incoming-call ringing (see `cometchat-react-calls/references/voip-and-web-push.md` for that limit), but it does have **Web Push** for new-message notifications when the user's tab is backgrounded or closed. This skill wires the full path: client subscription → server webhook → push send → notification → click-through.\n\n**Not the same as the calls Web Push.** Calls Web Push tries to ring the device through a closed tab (best-effort, browser-dependent). Chat Web Push notifies on new messages — fundamentally similar plumbing, different payload + UX. Many apps need both.\n\n**Read these other skills first:**\n- `cometchat-core` — provider pattern, login order\n- `cometchat-{react,nextjs,react-router,astro}-patterns` — framework-specific Service Worker registration\n- `cometchat-react-calls/references/voip-and-web-push.md` — calls-specific Web Push (overlap with this; both can coexist)\n- `cometchat-production` — server-minted auth tokens (push payloads should NOT contain Auth Key)\n\n**Ground truth:**\n- Web Push spec — https://datatracker.ietf.org/doc/html/rfc8030\n- VAPID — https://datatracker.ietf.org/doc/html/rfc8292\n- Push API — https://developer.mozilla.org/en-US/docs/Web/API/Push_API\n- CometChat dashboard `PushNotifications` (formerly Extensions → Enhanced Push Notifications)\n\n---\n\n## 1. Architecture\n\n```\nBrowser (your React app)\n  ├── Service Worker — long-lived; receives push events\n  ├── Push subscription — issued by browser, sent to your server\n  └── Notification UI — fired by SW on push event\n\nCometChat backend\n  └── Webhook → your push server when a message is sent\n\nYour push server (Node, Cloudflare Worker, Lambda, etc.)\n  ├── Stores push subscriptions per UID\n  ├── Receives CometChat webhook\n  └── Sends push payload via web-push lib → browser\n```\n\nThree pieces, all yours: client SW, push server, webhook integration. CometChat doesn't host the push server for you — its dashboard's \"PushPlatform\" config is for FCM/APNs (mobile), not Web Push.\n\n---\n\n## 2. Generate VAPID keys (server-side, one-time)\n\nVAPID = Voluntary Application Server Identification — proves to the browser that the push originated from an authorized server.\n\n```bash\nnpx web-push generate-vapid-keys\n```\n\nOutput:\n```\n=======================================\nPublic Key: BLBz-...\nPrivate Key: 9tT...\n=======================================\n```\n\nPublic key → client (env var). Private key → push server only (never ship to client).\n\n---\n\n## 3. Service Worker\n\n### `public/sw.js` (Vite / CRA / React Router) or `app/sw.js` (Next.js / Astro)\n\n```js\n// Fired when a push payload arrives\nself.addEventListener(\"push\", (event) => {\n  if (!event.data) return;\n\n  let payload;\n  try {\n    payload = event.data.json();\n  } catch {\n    return;\n  }\n\n  if (payload.type !== \"new_message\") return;\n\n  event.waitUntil(\n    self.registration.showNotification(payload.senderName, {\n      body: payload.preview,                          // truncated message\n      icon: payload.senderAvatar ?? \"/icons/chat.png\",\n      tag: `chat-${payload.conversationId}`,          // dedupe — replace prior unread for same conversation\n      badge: \"/icons/badge.png\",\n      data: {\n        conversationId: payload.conversationId,\n        senderUid: payload.senderUid,\n        receiverType: payload.receiverType,           // \"user\" or \"group\"\n      },\n    }),\n  );\n});\n\n// Fired when user clicks the notification\nself.addEventListener(\"notificationclick\", (event) => {\n  event.notification.close();\n\n  const data = event.notification.data;\n  const targetUrl = data.receiverType === \"group\"\n    ? `/messages?group=${data.conversationId}`\n    : `/messages?user=${data.senderUid}`;\n\n  event.waitUntil(\n    clients.matchAll({ type: \"window\", includeUncontrolled: true }).then((wins) => {\n      // Focus existing tab if open\n      for (const w of wins) {\n        if (w.url.includes(self.registration.scope)) {\n          w.focus();\n          w.postMessage({ type: \"open_conversation\", ...data });\n          return;\n        }\n      }\n      // Otherwise open a new tab\n      return clients.openWindow(targetUrl);\n    }),\n  );\n});\n\n// Optional: fired when a notification is dismissed without click\nself.addEventListener(\"notificationclose\", (event) => {\n  // Send a \"dismissed\" beacon to your server if you track this\n});\n```\n\n---\n\n## 4. Client-side registration\n\n```ts\n// cometchat/registerWebPush.ts\nconst VAPID_PUBLIC = import.meta.env.VITE_VAPID_PUBLIC_KEY;     // adjust prefix per framework\n\nexport async function registerWebPushForChat(uid: string): Promise<void> {\n  if (!(\"serviceWorker\" in navigator) || !(\"PushManager\" in window)) return;\n\n  // Register the SW (one-time per origin)\n  const reg = await navigator.serviceWorker.register(\"/sw.js\");\n\n  // Wait for SW activation\n  await navigator.serviceWorker.ready;\n\n  // Ask permission — must be in response to a user gesture (click)\n  const permission = await Notification.requestPermission();\n  if (permission !== \"granted\") return;\n\n  // Get or create subscription\n  let subscription = await reg.pushManager.getSubscription();\n  if (!subscription) {\n    subscription = await reg.pushManager.subscribe({\n      userVisibleOnly: true,                          // required by Chrome\n      applicationServerKey: urlBase64ToUint8Array(VAPID_PUBLIC),\n    });\n  }\n\n  // Send subscription to YOUR push server, keyed by uid\n  await fetch(\"/api/push/subscribe\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ uid, subscription }),\n  });\n}\n\nfunction urlBase64ToUint8Array(base64: string): Uint8Array {\n  const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n  const raw = atob((base64 + padding).replace(/-/g, \"+\").replace(/_/g, \"/\"));\n  return Uint8Array.from(raw, (c) => c.charCodeAt(0));\n}\n```\n\nCall this from your CometChatProvider AFTER login resolves:\n\n```tsx\n// CometChatProvider.tsx\nuseEffect(() => {\n  if (!user) return;\n  registerWebPushForChat(user.uid).catch((err) => {\n    // surface to UI but don't block chat — push is opt-in\n    console.warn(\"Web Push registration failed:\", err);\n  });\n}, [user]);\n```\n\n**The permission prompt rule:** Chrome / Firefox / Safari all require permission requests in response to a user gesture. If you call `Notification.requestPermission()` from a top-level `useEffect` that runs on page load, browsers reject it. Best pattern: a \"Enable notifications\" button the user clicks once.\n\n---\n\n## 5. Listen for SW messages in the React app\n\n```tsx\n// CometChatProvider.tsx\nuseEffect(() => {\n  if (!(\"serviceWorker\" in navigator)) return;\n\n  const handler = (event: MessageEvent) => {\n    if (event.data?.type === \"open_conversation\") {\n      navigate(`/messages?${event.data.receiverType}=${event.data.conversationId}`);\n    }\n  };\n  navigator.serviceWorker.addEventListener(\"message\", handler);\n  return () => navigator.serviceWorker.removeEventListener(\"message\", handler);\n}, [navigate]);\n```\n\nWhen the SW posts `open_conversation`, the React app navigates to the right thread.\n\n---\n\n## 6. Server-side push send\n\nYour push server runs on Node.js / Cloudflare Worker / Lambda / Vercel Functions. The shape:\n\n```ts\n// server/push.ts\nimport express from \"express\";\nimport webpush from \"web-push\";\nimport { z } from \"zod\";\n\nwebpush.setVapidDetails(\n  \"mailto:notifications@yourapp.com\",\n  process.env.VAPID_PUBLIC!,\n  process.env.VAPID_PRIVATE!,\n);\n\nconst app = express();\napp.use(express.json());\n\n// 1. Client registers a subscription\napp.post(\"/api/push/subscribe\", async (req, res) => {\n  const { uid, subscription } = req.body;          // validate with zod in production\n  await db.savePushSubscription(uid, subscription);\n  res.status(204).send();\n});\n\n// 2. CometChat fires a webhook when a message is sent\napp.post(\"/webhook/cometchat/message-sent\", async (req, res) => {\n  const { receiver, sender, data } = req.body.data;\n\n  // Don't notify the sender — they sent the message\n  const subs = await db.getPushSubscriptions(receiver);\n  if (!subs.length) return res.status(204).send();\n\n  const payload = JSON.stringify({\n    type: \"new_message\",\n    conversationId: receiver,\n    senderUid: sender.uid,\n    senderName: sender.name,\n    senderAvatar: sender.avatar,\n    preview: truncate(data.text, 80),\n    receiverType: data.entityType,                 // \"user\" or \"group\"\n  });\n\n  // Send to all of receiver's subscriptions in parallel; clean up dead ones\n  await Promise.allSettled(\n    subs.map(async (sub) => {\n      try {\n        await webpush.sendNotification(sub, payload);\n      } catch (err: unknown) {\n        if ((err as { statusCode?: number }).statusCode === 410) {\n          await db.removePushSubscription(receiver, sub);   // browser unsubscribed\n        }\n      }\n    }),\n  );\n\n  res.status(204).send();\n});\n\nfunction truncate(s: string, n: number) {\n  return s.length <= n ? s : s.slice(0, n - 1) + \"…\";\n}\n\napp.listen(3000);\n```\n\nThe skill writes a starter version of this server file (`server/push.example.ts`) with a README pointing at env vars; the user owns the actual deployment.\n\n---\n\n## 7. CometChat webhook setup (manual)\n\nIn the CometChat dashboard:\n\n1. Navigate to **Webhooks**.\n2. Click **+ Webhook**.\n3. URL: `https://your-push-server.example.com/webhook/cometchat/message-sent`\n4. Trigger: **Message sent**\n5. Verification: copy the signing secret to your push server's env (`COMETCHAT_WEBHOOK_SECRET`).\n\nThe webhook fires for EVERY message — your server filters out the sender, dedupes per conversation, and respects user notification preferences.\n\n---\n\n## 8. Webhook signature verification\n\n```ts\nimport crypto from \"crypto\";\n\napp.use(\"/webhook/cometchat\", (req, res, next) => {\n  const signature = req.header(\"x-cometchat-signature\");\n  const expected = crypto\n    .createHmac(\"sha256\", process.env.COMETCHAT_WEBHOOK_SECRET!)\n    .update(JSON.stringify(req.body))\n    .digest(\"hex\");\n  if (signature !== expected) return res.status(401).send({ error: \"invalid signature\" });\n  next();\n});\n```\n\nWithout this, anyone with your endpoint URL can flood your users with fake notifications.\n\n---\n\n## 9. Browser support matrix + iOS PWA caveat\n\n| Browser | Web Push | Notification while closed | Notes |\n|---|---|---|---|\n| Chrome desktop | ✓ | ✓ if Chrome process alive | Service Worker terminates after ~30s idle |\n| Edge desktop | ✓ | ✓ | Same as Chrome |\n| Firefox desktop | ✓ | ✓ | Slightly more SW survival |\n| Safari 16+ desktop | ✓ | ✓ if Safari running | macOS 13+ |\n| Safari 16.4+ iOS | ✓ | **Only when added to Home Screen as PWA** | Critical caveat |\n| Chrome mobile | ✓ | ✓ | Aggressive throttling on Android |\n| Edge mobile | ✓ | ✓ | Same as Chrome mobile |\n\n**iOS PWA-only requirement:** iOS 16.4+ supports Web Push, but ONLY for sites added to the Home Screen as a PWA. Safari-the-browser-app does NOT receive Web Push. To unlock iOS Web Push:\n\n1. App must have a `manifest.json` (PWA manifest)\n2. User must use Safari → Share → \"Add to Home Screen\"\n3. Subsequent push subscriptions and notifications work as expected\n\nThis is a real production constraint. The skill detects whether the project ships a `manifest.json` and warns if not.\n\n---\n\n## 10. Framework-specific Service Worker registration\n\n### Vite / React (CRA)\n\n`public/sw.js` is served from `/sw.js`. `register(\"/sw.js\")` works directly.\n\n### Next.js (App Router)\n\nService Workers + Next.js have a known gotcha: the SW can't be inside `app/` because Next handles those routes. Place it in `public/sw.js` and serve from `/sw.js`. Register from a `\"use client\"` component that runs after hydration.\n\n### Next.js (Pages Router)\n\nSame — `public/sw.js`.\n\n### React Router\n\n`public/sw.js` works. If using SSR (loaders), the SW registration code must be guarded by `typeof window !== \"undefined\"`.\n\n### Astro\n\nPlace the SW at `public/sw.js`. Register from a `client:only=\"react\"` island.\n\nThe framework-specific patterns skills cover the SSR guards in detail.\n\n---\n\n## 11. HTTPS requirement\n\nService Workers + Push API both require HTTPS (or `localhost` for dev). The skill detects the dev server protocol and warns:\n\n```\n⚠️  Web Push requires HTTPS or localhost. Your dev server is running on http://192.168.x.x.\n   Web Push subscriptions will fail. Either:\n   - Use http://localhost (Chrome/Firefox/Safari all allow Push API on localhost), or\n   - Set up HTTPS dev (mkcert, ngrok, or Vite's --https flag)\n```\n\nFor production, the Vercel / Netlify / Cloudflare default deploys are HTTPS — no extra work.\n\n---\n\n## 12. Anti-patterns\n\n1. **Calling `Notification.requestPermission()` on page load.** Browsers reject this. Wire to a user-clicked \"Enable notifications\" button.\n2. **Sending the Auth Key in push payloads.** Push payloads are visible in the SW; never include credentials. Use the user's UID as a key into your server's session store.\n3. **Missing webhook signature verification.** Without HMAC verification, anyone with the URL can spoof notifications.\n4. **Showing notifications even when the chat tab is open.** Check `clients.matchAll()` from the SW and skip if the user already has the chat focused.\n5. **Skipping the iOS PWA warning.** iOS users will silently get nothing. The skill explicitly tells them to \"Add to Home Screen.\"\n6. **Service Worker registered before login completes.** Race conditions where the subscription exists but the server doesn't know whose UID it belongs to. Register from inside the auth state effect.\n7. **Forgetting subscription cleanup on logout.** The previous user's subscription keeps notifying them with the new user's messages. Call `subscription.unsubscribe()` and DELETE the server record on logout.\n\n---\n\n## 13. Logout cleanup\n\n```ts\nasync function unsubscribeWebPush(uid: string): Promise<void> {\n  const reg = await navigator.serviceWorker.getRegistration();\n  if (!reg) return;\n  const subscription = await reg.pushManager.getSubscription();\n  if (!subscription) return;\n\n  await fetch(\"/api/push/unsubscribe\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ uid, subscription }),\n  });\n  await subscription.unsubscribe();\n}\n```\n\nCall this from your logout flow before `CometChat.logout()`.\n\n---\n\n## 14. Verification checklist\n\n- [ ] `public/sw.js` (or framework equivalent) exists and listens for `push` + `notificationclick` events\n- [ ] VAPID public key in client env vars (correct framework prefix)\n- [ ] VAPID private key in server env, NOT client\n- [ ] `Notification.requestPermission()` triggered from a user gesture, not page load\n- [ ] Push subscription registered AFTER login resolves\n- [ ] Subscription POSTed to your push server, keyed by CometChat UID\n- [ ] CometChat dashboard webhook configured for `Message sent` events\n- [ ] Webhook signature verification on the push server (HMAC SHA256)\n- [ ] Notifications dedupe per conversation via `tag` field\n- [ ] `notificationclick` focuses existing tab via `clients.matchAll` OR opens new tab\n- [ ] Foreground tab does NOT show notifications (check tab focus before `showNotification`)\n- [ ] Logout flow calls `subscription.unsubscribe()` and deletes server record\n- [ ] HTTPS or localhost only (warned otherwise)\n- [ ] `manifest.json` shipped if iOS users are expected (PWA caveat)\n- [ ] Server cleanup of dead subscriptions on 410 response\n\n---\n\n## 15. Pointers\n\n- `cometchat-react-calls/references/voip-and-web-push.md` — Web Push for incoming calls (overlap; both can coexist on the same SW)\n- `cometchat-{react,nextjs,react-router,astro}-patterns` — framework-specific SSR handling\n- `cometchat-production` — auth tokens, security\n- `cometchat-troubleshooting` — Web Push debugging (chrome://serviceworker-internals, Firefox about:debugging)","tags":["cometchat","react","push","skills","agent-skills","ai-agent","chat","claude-code","cursor","messaging","nextjs","react-native"],"capabilities":["skill","source-cometchat","skill-cometchat-react-push","topic-agent-skills","topic-ai-agent","topic-chat","topic-claude-code","topic-cometchat","topic-cursor","topic-messaging","topic-nextjs","topic-react","topic-react-native","topic-ui-kit"],"categories":["cometchat-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/cometchat/cometchat-skills/cometchat-react-push","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add cometchat/cometchat-skills","source_repo":"https://github.com/cometchat/cometchat-skills","install_from":"skills.sh"}},"qualityScore":"0.463","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 27 github stars · SKILL.md body (15,727 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:04:55.970Z","embedding":null,"createdAt":"2026-05-18T07:04:29.761Z","updatedAt":"2026-05-18T19:04:55.970Z","lastSeenAt":"2026-05-18T19:04:55.970Z","tsv":"'/_/g':679 '/api/push/subscribe':647,874 '/api/push/unsubscribe':1698 '/doc/html/rfc8030':219 '/doc/html/rfc8292':223 '/en-us/docs/web/api/push_api':228 '/g':677 '/icons/badge.png':450 '/icons/chat.png':438 '/messages':478,481,796 '/references/voip-and-web-push.md':72,185,1859 '/sw.js':588,1325,1327,1359 '/webhook/cometchat':1109 '/webhook/cometchat/message-sent':905,1059 '0':685,1010 '1':237,868,1012,1048,1265,1500 '10':1311 '11':1419 '12':1496 '13':1202,1672 '14':1720 '15':1853 '16':1196 '16.4':1204,1234 '192.168':1454 '2':335,894,1052,1273,1518 '204':892,932,997 '3':392,1055,1283,1550 '3000':1014 '30s':1182 '4':543,667,669,670,1060,1565 '401':1138 '410':989,1851 '5':769,1064,1590 '6':821,1612 '7':1039,1643 '8':1099 '80':951 '9':1158 '9tt':377 'activ':592 'actual':1037 'ad':1208,1242 'add':1279,1608 'adjust':557 'aggress':1218 'aliv':1177 'allow':1466 'alreadi':1585 'android':1221 'anti':1498 'anti-pattern':1497 'anyon':1146,1558 'api':32,34,225,1425,1468 'app':152,242,777,815,864,1254,1266,1331,1346 'app.listen':1013 'app.post':873,904 'app.use':866,1108 'app/sw.js':401 'applic':347 'application/json':654,1705 'applicationserverkey':632 'architectur':238 'arriv':410 'ask':595 'astro':18,173,403,1394,1879 'async':562,875,906,973,1676 'atob':673 'auth':203,210,1521,1640,1889 'author':360 'await':586,593,608,620,625,645,887,925,970,976,990,1684,1691,1696,1710 'backend':269 'background':93 'badg':449 'base64':661,674 'base64.length':668 'bash':362 'beacon':535 'belong':1634 'best':133,759 'best-effort':132 'blbz':374 'block':710 'bodi':432,655,1706 'browser':136,239,255,303,353,756,994,1159,1165,1253,1506 'browser-depend':135 'button':764,1517 'c':683 'c.charcodeat':684 'call':65,71,117,120,184,187,686,743,1501,1663,1712,1824,1858,1864 'calls-specif':186 'catch':422,702,980 'caveat':1164,1215,1844 'chat':52,138,440,711,1571,1588 'check':1575,1817 'checklist':1722 'chrome':631,728,1172,1175,1188,1216,1226 'chrome/firefox/safari':1464 'clean':966 'cleanup':1646,1674,1846 'click':110,464,528,605,767,1053,1514 'click-through':109 'client':102,308,380,391,545,869,1364,1403,1738,1751 'client-sid':544 'clients.matchall':485,1576,1806 'clients.openwindow':518 'close':95,130,1170 'cloudflar':283,833,1488 'code':1386 'coexist':196,1868 'cometchat':2,8,37,51,69,161,167,182,198,229,268,293,314,895,1040,1046,1076,1118,1775,1777,1856,1873,1887,1893 'cometchat-cor':160 'cometchat-product':197,1886 'cometchat-react-cal':68,181,1855 'cometchat-react-push':1 'cometchat-troubleshoot':1892 'cometchat.logout':1719 'cometchat/registerwebpush.ts':549 'cometchatprovid':690 'cometchatprovider.tsx':695,779 'complet':1618 'compon':1365 'condit':1620 'config':327 'configur':40,1780 'console.warn':717 'const':471,474,498,550,584,606,664,671,786,863,878,909,923,934,1113,1120,1682,1689 'constraint':1297 'contain':209 'content':652,1703 'content-typ':651,1702 'convers':448,509,794,812,1093,1797 'conversationid':452,940 'copi':1066 'core':162 'correct':1741 'cover':26,1413 'cra':397,1320 'creat':616 'createhmac':1123 'credenti':1535 'critic':1214 'crypto':1105,1107,1122 'dashboard':38,230,324,1047,1778 'data':451,472,510,912 'data.conversationid':480 'data.entitytype':953 'data.receivertype':476 'data.senderuid':483 'data.text':950 'datatracker.ietf.org':218,222 'datatracker.ietf.org/doc/html/rfc8030':217 'datatracker.ietf.org/doc/html/rfc8292':221 'db.getpushsubscriptions':926 'db.removepushsubscription':991 'db.savepushsubscription':888 'dead':968,1848 'debug':1897,1903 'dedup':442,1091,1795 'default':1489 'delet':1666,1827 'depend':137 'deploy':1038,1490 'desktop':1173,1185,1190,1197 'detail':1418 'detect':1300,1435 'dev':1432,1437,1449,1475 'developer.mozilla.org':227 'developer.mozilla.org/en-us/docs/web/api/push_api':226 'devic':127 'differ':148 'digest':1131 'direct':1329 'dismiss':526,534 'doesn':21,315,1628 'edg':1184,1222 'effect':1642 'effort':134 'either':1461 'enabl':762,1515 'endpoint':1149 'enhanc':234 'env':381,1031,1075,1739,1749 'equival':61,1726 'err':703,722,981,984 'error':1140 'etc':286 'even':1568 'event':250,267,413,469,531,788,1733,1784 'event.data':415,791 'event.data.conversationid':798 'event.data.json':421 'event.data.receivertype':797 'event.notification.close':470 'event.notification.data':473 'event.waituntil':429,484 'everi':1083 'exist':493,1624,1727,1803 'expect':1121,1135,1291,1842 'explicit':1604 'export':561 'express':843,845,865 'express.json':867 'extens':233 'extra':1494 'fail':721,1460 'fake':1156 'fcm/apns':330 'fetch':646,1697 'field':1800 'file':1024 'filter':1087 'fire':262,405,461,521,896,1081 'firefox':729,1189,1901 'first':159 'flag':1482 'flood':1152 'flow':1717,1823 'focus':492,1589,1802,1819 'foreground':1811 'forget':1644 'former':232 'framework':176,560,1313,1409,1725,1742,1882 'framework-specif':175,1312,1408,1881 'full':100 'function':563,659,837,999,1677 'fundament':145 'generat':336,368 'generate-vapid-key':367 'gestur':604,740,1757 'get':614,1600 'gotcha':1339 'grant':612 'ground':212 'group':460,477,479,956 'guard':1389,1416 'handl':1349,1885 'handler':787,801,805 'header':650,1701 'hex':1132 'hmac':1556,1792 'home':1210,1245,1281,1610 'host':317 'https':1420,1428,1445,1474,1481,1492,1830 'hydrat':1369 'icon':436 'identif':349 'idl':1183 'import':842,846,852,1104 'import.meta.env.vite':553 'includ':1534 'includeuncontrol':488 'incom':64,1863 'incoming-cal':63 'insid':1345,1638 'integr':313 'intern':1900 'invalid':1141 'io':1162,1205,1228,1233,1262,1593,1596,1839 'island':1406 'issu':253 'js':404 'json.stringify':656,936,1129,1707 'keep':1654 'key':36,211,338,370,373,376,379,384,556,642,1522,1543,1736,1746,1773 'kit':11 'know':1630 'known':1338 'lambda':285,835 'let':417,618 'level':749 'lib':302 'limit':75 'listen':770,1729 'live':247 'load':755,1505,1760 'loader':1382 'localhost':1430,1447,1463,1470,1832 'login':165,692,1617,1765 'logout':1648,1671,1673,1716,1822 'long':246 'long-liv':245 'maco':1201 'mailto':857 'mani':151 'manifest':1272 'manifest.json':1270,1306,1836 'manual':1043 'matrix':1161 'messag':85,144,276,427,435,773,800,804,901,922,939,1062,1084,1662,1782 'messageev':789 'method':648,1699 'mint':202 'miss':1551 'mkcert':1476 'mobil':331,1217,1223,1227 'must':597,1267,1275,1387 'n':1003,1007,1011 'nativ':24,57 'navig':571,784,795,806,816,1049 'navigator.serviceworker.addeventlistener':799 'navigator.serviceworker.getregistration':1685 'navigator.serviceworker.ready':594 'navigator.serviceworker.register':587 'navigator.serviceworker.removeeventlistener':803 'need':153 'netlifi':1487 'never':388,1533 'new':84,143,426,515,938,1659,1809 'new-messag':83 'next':1112,1143,1348 'next.js':15,402,1330,1335,1370 'nextj':169,1875 'ngrok':1477 'node':282 'node.js':832 'note':1171 'noth':1601 'notif':6,33,86,108,236,260,466,524,763,1097,1157,1168,1288,1516,1564,1567,1794,1816 'notifi':141,916,1655 'notification.requestpermission':609,744,1502,1752 'notificationclick':468,1732,1801 'notificationclos':530 'notifications@yourapp.com':858 'npx':363 'number':987,1004 'one':343,580,969 'one-tim':342,579 'open':496,508,513,793,811,1574,1808 'opt':715 'opt-in':714 'option':520 'order':166 'origin':357,583 'otherwis':512,1835 'output':371 'overlap':191,1865 'own':1035 'pad':665,675 'page':754,1371,1504,1759 'parallel':965 'path':101 'pattern':164,174,760,1411,1499,1880 'payload':149,206,297,409,418,420,935,979,1525,1527 'payload.conversationid':441,453 'payload.preview':433 'payload.receivertype':457 'payload.senderavatar':437 'payload.sendername':431 'payload.senderuid':455 'payload.type':425 'per':290,559,582,1092,1796 'permiss':596,607,611,725,733 'piec':305 'place':1352,1395 'plumb':147 'point':1029 'pointer':1854 'post':649,810,1700,1768 'prefer':1098 'prefix':558,1743 'preview':948 'previous':1650 'prior':444 'privat':375,383,862,1745 'process':1176 'process.env.cometchat':1125 'process.env.vapid':859,861 'product':199,886,1296,1484,1888 'project':19,1303 'promis':567,1681 'promise.allsettled':971 'prompt':726 'protocol':1439 'prove':350 'provid':163 'public':372,378,552,555,635,860,1735 'public/sw.js':395,1321,1355,1374,1377,1399,1723 'purpos':47 'push':4,5,25,28,31,49,60,81,106,119,122,140,190,205,215,224,235,249,251,266,272,280,288,296,301,310,319,334,356,366,385,408,412,640,712,719,825,828,851,1072,1167,1237,1259,1264,1285,1424,1443,1457,1467,1524,1526,1731,1761,1771,1790,1861,1896 'pushmanag':572 'pushnotif':231 'pushplatform':39,326 'pwa':1163,1213,1230,1249,1271,1594,1843 'pwa-on':1229 'race':1619 'raw':672,682 'react':3,9,16,70,168,171,183,241,398,776,814,1319,1375,1405,1857,1874,1877 'react-rout':170,1876 'read':155 'readm':1028 'real':1295 'receiv':248,292,910,927,941,961,992,1257 'receivertyp':456,952 'record':1669,1829 'reg':585,1683,1687 'reg.pushmanager.getsubscription':621,1692 'reg.pushmanager.subscribe':626 'regist':576,870,1326,1360,1400,1615,1636,1763 'registerwebpushforchat':564,700 'registr':180,547,720,1317,1385 'reject':757,1507 'repeat':666 'replac':443,676,678 'req':876,907,1110 'req.body':881,1130 'req.body.data':913 'req.header':1115 'request':734 'requir':629,732,1232,1421,1427,1444 'res':877,908,1111 'res.status':891,931,996,1137 'resolv':693,1766 'respect':1095 'respons':600,736,1852 'return':416,423,428,511,517,575,613,680,699,785,802,930,1005,1136,1688,1695 'right':819 'ring':66,125 'rout':1351 'router':17,172,399,1332,1372,1376,1878 'rule':727 'run':752,830,1200,1367,1452 's.length':1006 's.slice':1009 'safari':730,1195,1199,1203,1251,1277 'safari-the-browser-app':1250 'screen':1211,1246,1282,1611 'secret':1069,1078,1127 'secur':1891 'see':67 'self.addeventlistener':411,467,529 'self.registration.scope':504 'self.registration.shownotification':430 'send':107,295,532,636,826,893,933,957,998,1139,1519 'sender':911,918,1090 'sender.avatar':947 'sender.name':945 'sender.uid':943 'senderavatar':946 'sendernam':944 'senderuid':454,942 'sent':256,278,903,920,1063,1783 'serv':1323,1357 'server':42,104,201,259,273,281,311,320,340,348,361,386,538,641,823,829,1023,1073,1086,1438,1450,1546,1627,1668,1748,1772,1791,1828,1845 'server-mint':200 'server-sid':41,339,822 'server/push.example.ts':1025 'server/push.ts':841 'servic':29,178,243,393,1178,1315,1333,1422,1613 'servicework':569,782,1899 'serviceworker-intern':1898 'session':1548 'set':1472 'setup':1042 'sha256':1124,1793 'shape':839 'share':1278 'ship':389,1304,1837 'show':1566,1815 'shownotif':1821 'side':43,341,546,824 'sign':1068 'signatur':1101,1114,1119,1134,1142,1553,1786 'silent':1599 'similar':146 'site':1241 'skill':97,158,1016,1299,1412,1434,1603 'skill-cometchat-react-push' 'skip':1581,1591 'slight':1191 'source-cometchat' 'spec':216 'specif':177,188,1314,1410,1883 'spoof':1563 'ssr':1381,1415,1884 'starter':1019 'state':1641 'statuscod':986,988 'store':287,1549 'string':566,662,1002,1680 'sub':924,974,978,993 'subs.length':929 'subs.map':972 'subscript':103,252,289,617,619,623,624,637,658,872,880,890,963,1286,1458,1623,1645,1653,1690,1694,1709,1762,1767,1849 'subscription.unsubscribe':1664,1711,1825 'subsequ':1284 'support':1160,1235 'surfac':704 'surviv':1194 'sw':264,309,578,591,772,809,1193,1341,1384,1397,1532,1579,1872 'tab':91,131,494,516,1572,1804,1810,1812,1818 'tag':439,1799 'targeturl':475,519 'tell':1605 'termin':1180 'thread':820 'three':304 'throttl':1219 'time':344,581 'token':204,1890 'top':748 'top-level':747 'topic-agent-skills' 'topic-ai-agent' 'topic-chat' 'topic-claude-code' 'topic-cometchat' 'topic-cursor' 'topic-messaging' 'topic-nextjs' 'topic-react' 'topic-react-native' 'topic-ui-kit' 'track':541 'tri':123,419,975 'trigger':1061,1753 'troubleshoot':1894 'true':489,628 'truncat':434,949,1000 'truth':213 'ts':548,840,1103,1675 'tsx':694,778 'type':486,507,653,792,937,1704 'typeof':1391 'ui':10,261,706 'uid':291,565,644,657,879,889,1540,1632,1679,1708,1776 'uint8array':663 'uint8array.from':681 'undefin':1393 'unknown':982 'unlock':1261 'unread':445 'unsubscrib':995 'unsubscribewebpush':1678 'updat':1128 'url':1056,1150,1561 'urlbase64touint8array':633,660 'use':1276,1363,1380,1462,1536 'useeffect':696,750,780 'user':89,458,463,482,603,698,723,739,766,954,1034,1096,1154,1274,1513,1538,1584,1597,1651,1660,1756,1840 'user-click':1512 'user.uid':701 'uservisibleon':627 'ux':150 'v6':12 'valid':882 'vapid':35,220,337,345,369,551,554,634,1734,1744 'var':382,1032,1740 'vercel':836,1486 'verif':1065,1102,1554,1557,1721,1787 'version':1020 'via':298,1798,1805 'visibl':1529 'vite':14,396,1318,1479 'voip':59 'voip-push':58 'voluntari':346 'w':499 'w.focus':505 'w.postmessage':506 'w.url.includes':503 'wait':589 'warn':1308,1441,1595,1834 'web':20,27,48,54,80,118,121,139,189,214,300,333,365,718,850,1166,1236,1258,1263,1442,1456,1860,1895 'web-push':299,364,849 'webhook':44,105,270,294,312,898,1041,1051,1054,1077,1080,1100,1126,1552,1779,1785 'webpush':847 'webpush.sendnotification':977 'webpush.setvapiddetails':856 'whether':1301 'whose':1631 'win':491,501 'window':487,574,1392 'wire':98,1509 'without':527,1144,1555 'work':1289,1328,1378,1495 'worker':30,179,244,284,394,834,1179,1316,1334,1423,1614 'write':1017 'x':1117 'x-cometchat-signatur':1116 'x.x':1455 'your-push-server.example.com':1058 'your-push-server.example.com/webhook/cometchat/message-sent':1057 'z':853 'zod':855,884","prices":[{"id":"75beca36-c67d-4f88-8bbe-2139954e78e8","listingId":"dd31d8f2-36b9-437f-823c-d0862f0b2927","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"cometchat","category":"cometchat-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T07:04:29.761Z"}],"sources":[{"listingId":"dd31d8f2-36b9-437f-823c-d0862f0b2927","source":"github","sourceId":"cometchat/cometchat-skills/cometchat-react-push","sourceUrl":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-react-push","isPrimary":false,"firstSeenAt":"2026-05-18T07:04:29.761Z","lastSeenAt":"2026-05-18T19:04:55.970Z"}],"details":{"listingId":"dd31d8f2-36b9-437f-823c-d0862f0b2927","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"cometchat","slug":"cometchat-react-push","github":{"repo":"cometchat/cometchat-skills","stars":27,"topics":["agent-skills","ai-agent","chat","claude-code","cometchat","cursor","messaging","nextjs","react","react-native","ui-kit"],"license":null,"html_url":"https://github.com/cometchat/cometchat-skills","pushed_at":"2026-05-18T05:04:24Z","description":"Add CometChat chat to any React, Next.js, React Native, Angular, Android, iOS, or Flutter project through your AI coding agent. Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and 50+ more agents.","skill_md_sha":"411649713f07075605bfccc43aab09a2e14d5fde","skill_md_path":"skills/cometchat-react-push/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-react-push"},"layout":"multi","source":"github","category":"cometchat-skills","frontmatter":{"name":"cometchat-react-push","license":"MIT","description":"Push notifications for CometChat React UI Kit v6 in Vite / Next.js / React Router / Astro projects. Web doesn't have native push — covers Web Push (Service Worker + Push API + Notification API + VAPID keys), CometChat dashboard PushPlatform configuration, server-side webhook to send pushes when a message arrives, click-through to chat, foreground vs background handling, iOS Safari 16.4+ PWA-only quirks, and HTTPS requirements.","compatibility":"React >= 18; Web Push API (Chrome 50+, Firefox 44+, Edge 17+, Safari 16+ desktop, Safari 16.4+ iOS PWA-only); HTTPS required (or localhost); CometChat dashboard PushPlatform configured"},"skills_sh_url":"https://skills.sh/cometchat/cometchat-skills/cometchat-react-push"},"updatedAt":"2026-05-18T19:04:55.970Z"}}