/cometchat-skills:cometchat-react-native-sdkfrom cometchat-skills
Maps CometChat Chat SDK v4 methods for React Native when the UI Kit lacks a component. Covers init/login ordering, listener lifecycle, and fallback paths for user/group details, banned members, and custom chat UIs.
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.
Read when SKILL.md points to them.
Ground truth:
@cometchat/chat-sdk-react-native@4+ catalogrn-sdk-v4.json(317 symbols). Signatures inreferences/method-map.mdare verbatim from the installed.d.ts, not from prose. Docs:/sdk/react-native/llms-react-native-v4.md(scoped index).
cometchat-react-native-core — install, provider chain, init→login→render. Assumed, not repeated here.The SDK ships under the UI Kit — if core is installed, so is this. A headless-only app
installs it alone:
npm install @cometchat/chat-sdk-react-native@4 @react-native-async-storage/async-storage@^2.1.2
⚠️ Not @cometchat/chat-sdk-javascript — that is the web package.
For any feature, check whether the UI Kit has a component (components skill + the catalog).
If it does, use it. Reach for the SDK only when it does not.
On React Native that fallback path is not rare. Kit v5 removed the detail and management screens, so these have no component at all and are pure SDK work:
| Need | Why there is no component | Map section |
|---|---|---|
| user / group details | CometChatDetails removed in v5 | Users & groups |
| add members | CometChatAddMembers removed | Users & groups |
| view / unban banned members | no UI surface exists at all | Users & groups |
| transfer ownership | CometChatTransferOwnership removed | Users & groups |
| call log detail | only the list ships | Calls |
references/page-map.md — the primary index, page-wise like the JavaScript SDK repo:
intent → the docs page → the methods that page demonstrates → the contract facts the RN page
does not carry. 37 pages, derived from the live docs so it cannot drift. Start here.
references/method-map.md — the per-method companion for when you already know the method
and need its exact signature, return type and constraints. 80 methods, 127/127 accounted for.
Both open with the same fallback ladder, and it matters: these cover most of the SDK, not all of it, so "not listed" never means "does not exist." Rung 2 is the catalog — that, not a map, is the existence authority.
Load page-map.md for any SDK question. It answers, per method: signature, what it resolves to, what it
rejects with, prerequisites, and what it will refuse to do. That last one matters most — it records
negative facts a docs page cannot express by omission, e.g. there is no sendCardMessage(),
which an agent would otherwise invent by symmetry with the three send methods that do exist.
Each row is marked D (backed by the RN docs) or T (recovered from the .d.ts because the RN
page is thin — RN-G15). Do not present a T row as documented; it is correct, and the docs gap
is real.
Init (initFromSettings) must resolve before login(). login() must resolve before you fetch or
send. Anything else fails quietly rather than throwing.
import { CometChat } from "@cometchat/chat-sdk-react-native";
// DEFAULT via skills: the ai-agent / telemetry-attributed init — persists integrationSource="ai-agent"
// (RULES §Ordering), the SDK sibling of the UI Kit's initFromSettings. Web/JS settings-OBJECT form,
// NOT the classic AppSettingsBuilder + init(APP_ID, settings). initFromSettings is @nodoc (ai-agent-only).
await CometChat.initFromSettings({
appId: APP_ID,
region: REGION,
credentials: { authKey: AUTH_KEY }, // dev only; prod logs in with an auth token
chatSDK: { presenceSubscription: { type: "ALL_USERS" } }, // = the old .subscribePresenceForAllUsers()
});
await CometChat.login(UID, AUTH_KEY); // dev only; production passes an auth token
// FALLBACK only (non-skills / doc-following context) — the publicly-documented classic path:
// const settings = new CometChat.AppSettingsBuilder()
// .setRegion(REGION).subscribePresenceForAllUsers().autoEstablishSocketConnection(true).build();
// await CometChat.init(APP_ID, settings);
⚠️ login is variadic and untyped in the .d.ts (login(...args: any)), so TypeScript will
not catch a wrong call. The two real shapes are login(uid, authKey) and login(authToken).
useEffect(() => {
const id = "chat-screen";
CometChat.addMessageListener(id, new CometChat.MessageListener({
onTextMessageReceived: (m) => setMessages((prev) => [...prev, m]),
}));
return () => CometChat.removeMessageListener(id); // NOT optional
}, []);
addMessageListener returns void, not a subscription — the string id is your only handle. The
SDK holds the listener, not React, so it survives navigation and unmount. Omitting the cleanup is
the top cause of duplicate messages, and it worsens the longer the app runs.
Lists are paginated: new CometChat.XRequestBuilder().setLimit(n).build() then .fetchNext().
An empty array means the end — it does not throw. There is no bare getMessages().
sendMessage() — everything is namespaced under CometChat.sendCardMessage() — card messages are receive-only.awaiting startTyping — it returns void.getLoggedinUser() returning null as an error — it is the normal no-session answer. (Note the lowercase in.)CometChatGroupMembers shows active members only; wire BannedMembersRequestBuilder + unbanGroupMember too.login resolves — it belongs to no user.catalogs/rn-sdk-v4.json.npm run verify:fences:rn-v5 is green.add*Listener has a matching remove*Listener on the teardown path.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, chat-sdk, react-native, headless, method-map, listener-lifecycle
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