Creator · cometchat
Last updated · Sep 7, 2026
Production-readiness for React Native — server-minted auth tokens, user management CRUD, external-backend recipes (Express / Hono / Firebase Functions / Vercel Serverless). RN has no API routes, so the backend is always external.
Sandbox only
Install targets
Codex install prompt
Install the "cometchat-native-production" agent skill from https://github.com/cometchat/cometchat-skills/tree/main/packages/skills-native/skills/cometchat-native-production. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Production-readiness for React Native — server-minted auth tokens, user management CRUD, external-backend recipes (Express / Hono / Firebase Functions / Vercel Serverless). RN has no API routes, so the backend is always external. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"cometchat-cometchat-native-production","task":"Install cometchat-native-production","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add cometchat/cometchat-skills --skill cometchat-native-production
Maintenance
active
1mo since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
100
61/100 Quality · 73/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
100 GitHub stars
Repo activity
100 stars, 2 forks
Maintenance
1mo since push
License
MIT
Install
npx skills add cometchat/cometchat-skills --skill cometchat-native-production
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add cometchat/cometchat-skills --skill cometchat-native-productionDo not use when
Alternative
168.6K Stars
npx skills add mattpocock/skills --skill code-review
Alternative
40.8K Stars
npx skills add appsmithorg/appsmith
Alternative
175.7K Stars
npx skills add mattpocock/skills --skill implement
Alternative
30.9K Stars
npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20cometchat-native-production%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20cometchat-native-production%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/cometchat-cometchat-native-production/install
Agent should check
Copy prompt
Task: Use cometchat-native-production in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20cometchat-native-production%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/cometchat-cometchat-native-production/install
Install command: npx skills add cometchat/cometchat-skills --skill cometchat-native-production
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/cometchat-cometchat-native-production/install
LLM text format
/api/skills/cometchat-cometchat-native-production/install?format=text
Find alternatives
/api/skills/search?q=cometchat-native-production&limit=3
Agent prompt
Use cometchat-native-production for this task. Review https://www.openagentskill.com/api/skills/cometchat-cometchat-native-production/install, then install with: npx skills add cometchat/cometchat-skills --skill cometchat-native-productionRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/cometchat-cometchat-native-production
LLM text
/api/registry/manifest/cometchat-cometchat-native-production?format=text
Install alias
/api/registry/install/cometchat-cometchat-native-production
Recommend
/api/registry/recommend?task=Use%20cometchat-native-production%20in%20an%20agent%20workflow&limit=3
Agent fit
Workflow automation
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Workflow automation
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO100 GitHub stars
Stars/forks activity
CHECK100 stars, 2 forks; issue activity unavailable in current metadata
Recent maintenance
PASS1mo since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
Implement work from an approved spec or ticket set, run focused and full tests, invoke code review, and commit the result to the current branch.
React and Next.js performance guidance for writing, reviewing, and refactoring production UI code.
--- name: cometchat-native-production description: "Production-readiness for React Native — server-minted auth tokens, user management CRUD, external-backend recipes (Express / Hono / Firebase Functions / Vercel Serverless). RN has no API routes, so the backend is always external." license: "MIT" compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5" allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion" metadata: author: "CometChat" version: "3.0.0" tags: "cometchat react-native production auth token security user-management rest-api" ---
## Purpose
Teaches Claude how to move a React Native CometChat integration from dev-mode Auth Key to production-ready server-minted auth tokens + user CRUD. Covers:
1. Why the dev `authKey` can't ship to production 2. Auth Key vs REST API Key — which lives where 3. Server endpoint recipes (Express / Hono / Firebase Functions / Vercel) 4. Client-side: `CometChatUIKit.login({ authToken })` + token refresh 5. User CRUD endpoints + auth-provider integration (Firebase Auth / Supabase / Clerk / Auth0) 6. Security checklist + rate limits
**Read `cometchat-native-core` first** (init/login/wrapper chain) before this skill — production just swaps one prop on the provider, but understanding the provider lifecycle is the prerequisite.
Ground truth: `docs/ui-kit/react-native/methods.mdx`, and the cross-platform REST API at `https://{APP_ID}.api-{REGION}.cometchat.io/v3/`.
---
## 1. Why production auth matters
In dev mode, `CometChatUIKit.login({ uid: "..." })` uses the `authKey` configured via `UIKitSettingsBuilder.setAuthKey()`. That key is embedded in your React Native bundle. For a signed iOS `.ipa` or Android `.apk`/`.aab`, anyone can extract it with standard reverse-engineering tools (unzip, strings, `apktool`, `ReverseAPK`) and use it to log in as **ANY** user in your CometChat app — read private messages, send as other users, access every conversation.
Production MUST use server-side token generation:
- Your **server** holds the REST API Key (a different key from the client Auth Key). - On user login, your server calls CometChat's REST API with the REST API Key to mint a short-lived **Auth Token** for that specific UID. - Your client receives the Auth Token and calls `CometChatUIKit.login({ authToken })`. - If the token leaks, the blast radius is one user session, not your whole app.
**Exactly the same threat model as JWTs for a REST API.** If you've built a login flow before, this is that.
---
## 2. Auth Key vs REST API Key — two different keys
Easy to confuse. Both come from the CometChat Dashboard (your app → API & Auth Keys), but they live in different places and have different privileges.
| Key | Where in dashboard | Purpose | Where it lives | |---|---|---|---| | **Auth Key** | "Auth Keys" table | Client-side SDK `login({ uid })` in dev mode | **Client bundle** — dev only. Never in production builds. | | **REST API Key** | "REST API Keys" table | Server-to-server: token generation, user CRUD, custom-message-send | **Server only.** Never in an RN bundle, `app.json extra`, `EXPO_PUBLIC_*` var, or git-committed file. |
If the project only has an Auth Key, the user needs to generate a REST API Key in the dashboard: **API & Auth Keys → REST API Keys → Add Key**. Pick "Full Access" for server-side use.
---
## 3. The token auth pattern (4 steps)
``` 1. Client logs into YOUR auth (Firebase Auth / Supabase / Clerk / Auth0 / custom) ↓ 2. Client asks YOUR backend for a CometChat auth token ↓ (POST /api/cometchat-token { uid }) 3. Backend calls CometChat REST API → gets an Auth Token for that UID ↓ POST https://{APP_ID}.api-{REGION}.cometchat.io/v3/users/{uid}/auth_tokens with header apiKey: <REST_API_KEY> ↓ 4. Client calls CometChatUIKit.login({ authToken: "..." }) ```
The RN client never sees the REST API Key. The server never ships a password or email to the client. The CometChat SDK holds the auth token, not a static key.
---
## 4. Server endpoint recipes
RN projects don't have Next.js-style API routes. You need a separate backend. Pick the one the user already has, or the simplest if they're starting fresh.
### 4a. Express (Node.js backend)
```ts // server/routes/cometchat-token.ts import { Router } from "express"; import { requireAuth } from "../middleware/auth"; // your existing auth
const router = Router(); const APP_ID = process.env.COMETCHAT_APP_ID!; const REGION = process.env.COMETCHAT_REGION!; const REST_API_KEY = process.env.COMETCHAT_REST_API_KEY!;
router.post("/cometchat-token", requireAuth, async (req, res) => { // Derive UID from authenticated session — NOT from the request body in prod. const uid = req.user.id;
const r = await fetch( `https://${APP_ID}.api-${REGION}.cometchat.io/v3/users/${encodeURIComponent(uid)}/auth_tokens`, { method: "POST", headers: { "Content-Type": "application/json", appId: APP_ID, apiKey: REST_API_KEY, }, body: JSON.stringify({}), }, );
if (!r.ok) { const error = await r.text(); console.error("CometChat token error:", error); return res.status(r.status).json({ error: "Failed to generate auth token" }); }
const data = await r.json(); return res.json({ authToken: data.data.authToken }); });
export default router; ```
### 4b. Hono (Cloudflare Workers / Bun / Node)
```ts // server/cometchat-token.ts import { Hono } from "hono";
const app = new Hono();
app.post("/api/cometchat-token", async (c) => { const user = c.get("user"); // your middleware-resolved user if (!user) return c.json({ error: "unauthorized" }, 401);
const APP_ID = c.env.COMETCHAT_APP_ID; const REGION = c.env.COMETCHAT_REGION; const REST_API_KEY = c.env.COMETCHAT_REST_API_KEY;
const r = await fetch( `https://${APP_ID}.api-${REGION}.cometchat.io/v3/users/${encodeURIComponent(user.id)}/auth_tokens`, { method: "POST", headers: { "Content-Type": "application/json", appId: APP_ID, apiKey: REST_API_KEY, }, body: JSON.stringify({}), }, );
if (!r.ok) return c.json({ error: "token mint failed" }, 502); const data = await r.json(); return c.json({ authToken: data.data.authToken }); });
export default app; ```
### 4c. Firebase Cloud Functions
```ts // functions/src/cometchat-token.ts import { onCall, HttpsError } from "firebase-functions/v2/https";
export const getCometChatToken = onCall( { secrets: ["COMETCHAT_APP_ID", "COMETCHAT_REGION", "COMETCHAT_REST_API_KEY"] }, async (request) => { if (!request.auth) throw new HttpsError("unauthenticated", "Sign in required"); const uid = request.auth.uid;
const APP_ID = process.env.COMETCHAT_APP_ID!; const REGION = process.env.COMETCHAT_REGION!; const REST_API_KEY = process.env.COMETCHAT_REST_API_KEY!;
const r = await fetch( `https://${APP_ID}.api-${REGION}.cometchat.io/v3/users/${encodeURIComponent(uid)}/auth_tokens`, { method: "POST", headers: { "Content-Type": "application/json", appId: APP_ID, apiKey: REST_API_KEY, }, body: JSON.stringify({}), }, );
if (!r.ok) throw new HttpsError("internal", "token mint failed"); const data = await r.json(); return { authToken: data.data.authToken }; }, ); ```
Client call:
```tsx import functions from "@react-native-firebase/functions"; const result = await functions().httpsCallable("getCometChatToken")(); const authToken = result.data.authToken; ```
### 4d. Vercel Serverless / Next.js API Route
Even if the RN app isn't Next.js, the user's existing web app often is. Reuse the same backend:
```ts // pages/api/cometchat-token.ts (or app/api/cometchat-token/route.ts) import type { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth"; import { authOptions } from "./auth/[...nextauth]";
export default async function handler(req: NextApiRequest, res: NextApiResponse) { if (req.method !== "POST") return res.status(405).end();
const session = await getServerSession(req, res, authOptions); if (!session?.user) return res.status(401).json({ error: "unauthorized" });
const APP_ID = process.env.COMETCHAT_APP_ID!; const REGION = process.env.COMETCHAT_REGION!; const REST_API_KEY = process.env.COMETCHAT_REST_API_KEY!; const uid = session.user.id;
const r = await fetch( `https://${APP_ID}.api-${REGION}.cometchat.io/v3/users/${encodeURIComponent(uid)}/auth_tokens`, { method: "POST", headers: { "Content-Type": "application/json", appId: APP_ID, apiKey: REST_API_KEY }, body: JSON.stringify({}), }, );
if (!r.ok) return res.status(502).json({ error: "token mint failed" }); const data = await r.json(); return res.json({ authToken: data.data.authToken }); } ```
---
## 5. Client-side: `CometChatUIKit.login({ authToken })`
Once the server is serving tokens, update the RN client to fetch the token and use it. This is a change to the `CometChatProvider` (see `cometchat-native-core` § 6) — swap the `uid` prop for an `authToken` prop.
### 5a. Update the provider to support authToken
```tsx // CometChatProvider.tsx — production-aware version import React, { createContext, useContext, useEffect, useState, type ReactNode } from "react"; import { CometChatUIKit, UIKitSettingsBuilder, } from "@cometchat/chat-uikit-react-native";
let initialized = false; let loginInFlight: Promise<unknown> | null = null;
async function ensureLoggedIn(authToken?: string, uid?: string): Promise<void> { const existing = await CometChatUIKit.getLoggedinUser(); if (existing) return; if (loginInFlight) { await loginInFlight; return; } // Production — prefer authToken if (authToken) { loginInFlight = CometChatUIKit.login({ authToken }); } else if (uid) { loginInFlight = CometChatUIKit.login({ uid }); // dev fallback } else { return; // nothing to log in with yet } try { await loginInFlight; } finally { loginInFlight = null; } }
interface Props { appId: string; region: string; authKey?: string; // dev only; omit in production authToken?: string; // production — from your backend uid?: string; // dev only children: ReactNode; }
export function CometChatProvider({ appId, region, authKey, authToken, uid, children }: Props) { const [isReady, setIsReady] = useState(false); const [error, setError] = useState<string | null>(null);
useEffect(() => { async function setup() { try { if (!initialized) { initialized = true; const builder = new UIKitSettingsBuilder() .setAppId(appId) .setRegion(region) .subscribePresenceForAllUsers(); if (authKey) builder.setAuthKey(authKey); await CometChatUIKit.init(builder.build()); } await ensureLoggedIn(authToken, uid); setIsReady(true); } catch (e) { setError(String(e)); } } setup(); }, [appId, region, authKey, authToken, uid]);
if (!isReady) return null; return <>{children}</>; } ```
**Push registration lands here** — right after `ensureLoggedIn` resolves, before `setIsReady(true)`. The CometChat SDK scopes push tokens to the logged-in user, so registering before login associates the token with "anonymous" and the device won't receive pushes.
```tsx import { bootstrapPushAfterLogin } from "../push/bootstrap"; //... await ensureLoggedIn(authToken, uid); await bootstrapPushAfterLogin(); // registers FCM/APNs token with CometChat setIsReady(true); ```
And unregister BEFORE `CometChatUIKit.logout()` — the SDK needs the user context to dissociate the token. See `cometchat-native-push § 7` for the full `bootstrapPushAfterLogin` / `unregisterPushTokenOnLogout` helper pair.
### 5b. Fetch the token from your backend
Typical app flow:
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for cometchat-native-production, ready for a manual X post.
cometchat-native-production: Production-readiness for React Native — server-minted auth tokens, user management CRUD, exte... 100 stars https://www.openagentskill.com/skills/cometchat-cometchat-native-production?ref=x
Listing + install path for cometchat-native-production: https://www.openagentskill.com/skills/cometchat-cometchat-native-production?ref=x Install: npx skills add cometchat/cometchat-skills --skill cometchat-native-production
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to cometchat but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-production?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-production?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-production/audit)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-production?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)cometchat
@cometchat
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Code Review
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
168.6K StarsAppsmith
Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
40.8K StarsImplement
Implement work from an approved spec or ticket set, run focused and full tests, invoke code review, and commit the result to the current branch.
175.7K StarsVercel React Best Practices
React and Next.js performance guidance for writing, reviewing, and refactoring production UI code.
30.9K StarsPermission surface
secrets or environment access, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness