/cometchat-skills:cometchat-react-v7-productionfrom cometchat-skills
Hardens CometChat React v7 for production: replaces Auth Key with server-minted auth tokens, configures env prefixes per bundler, and provides a pre-launch security checklist.
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:
@cometchat/chat-uikit-react@7. The auth-token / login API is FETCHED from the docs viacometchat-react-v7-core/references/docs-map.md(/ui-kit/react/integration-react+ the JS SDK auth pages); the REST auth-token endpoint is{DOCS_BASE}/rest-api/auth-tokens. The React UI Kit docs have no single production-hardening page — this checklist is the pack's own guidance fromRULES.md§4 (Credentials) + what the kit ships, labelled as such, not presented as documented. Tracked DOCS GAP.
cometchat-react-v7-core — references/setup-credentials.md + references/lifecycle.md cover the dev credential flow this replaces and the init→login→render order.cometchat-react-v7-patterns — the per-bundler env prefix + build specifics referenced below.cometchat-security — the enterprise auth model this client-side hardening plugs into: wiring your IdP / SSO into the token flow (your IdP → your server → mint the CometChat auth token; CometChat is not an IdP), token expiry/refresh + re-login, RBAC roles + group (SBAC) scopes, and Auth Key vs auth token vs REST API Key. Load it for a security review or any SSO question.Moving off the development setup: going live, a security review, or "is this safe to ship."
Never ship the Auth Key in the browser bundle.
The Auth Key can mint a session for any user in your app. Every VITE_/NEXT_PUBLIC_/REACT_APP_/PUBLIC_-prefixed value is compiled into JavaScript your users download — so an Auth Key there is public. Anyone can read it, log in as any UID, and read every conversation.
| Development | Production | |
|---|---|---|
| Login | CometChatUIKit.login(uid) | CometChatUIKit.loginWithAuthToken(token) |
| Auth Key | in the client env | absent from the bundle |
| Token source | n/a | your backend, per authenticated user |
| REST API Key | never client-side | server only |
{DOCS_BASE}/rest-api/auth-tokens).loginWithAuthToken(token).// the endpoint derives the UID from the SERVER session — never from a query param
const res = await fetch("/api/cometchat-token", { credentials: "include" });
const { authToken } = await res.json();
await CometChatUIKit.loginWithAuthToken(authToken);
Accepting ?uid= (or any client-supplied UID) lets a caller impersonate anyone. The UID must come from the server-side session.
Init reads the Auth Key from the client env in development. Production must set it empty and log in with a token instead. The prefix is bundler-specific (cometchat-react-v7-patterns): Vite VITE_, Next NEXT_PUBLIC_ (.env.local), CRA REACT_APP_, Astro PUBLIC_. App ID and Region are not secrets — they identify the app; the Auth Key is the secret. Grep the built bundle to be certain:
npm run build && grep -rll "<your-auth-key>" dist/ build/ .next/ 2>/dev/null && echo "LEAK" || echo "clean"
Run that in CI — a stray .env or a wrong prefix ships the key silently.
createUser with the Auth Key in client code).await CometChatUIKit.logout(), then clear derived React state and unregister push tokens (cometchat-react-v7-push).getUserMedia) and push.~ range so a minor cannot change component behaviour under you.CometChatErrorBoundary wrapping the surface so a render error shows a fallback, not a white screen (it is not the initializer — init/login still run first).cometchat-react-v7-patterns); never init during SSR — gate on the client.loginWithAuthToken in production; UID from the server session.env gitignoredCometChatErrorBoundary in placeProduction build contains no Auth Key (grep) · login works via token · a tampered UID is rejected by the server · logout fully clears · calls and push work over HTTPS · features enabled on the production app.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, react, production-hardening, auth-token, security-checklist
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