Skip to content
Skillv1.0.0

cometchat-android-v5-production

Production readiness for CometChat Android — server-side token auth, user management CRUD, ProGuard rules, and security checklist.

by cometchat(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from cometchat/cometchat-skills (skills/cometchat-android-v5-production/SKILL.md). Install upstream with npx skills add cometchat/cometchat-skills --skill cometchat-android-v5-production. Copyright stays with the author (MIT).

Ground truth: com.cometchat:chat-uikit-android:5.x (legacy/maintenance-only; +calls-sdk-android:5.x) — resolved AAR (javap) + ui-kit/android. Official docs: https://www.cometchat.com/docs/fundamentals/user-auth · Docs MCP: claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.

Companion skills: cometchat-android-v5-core covers dev-mode login; cometchat-android-v5-push covers push notification setup for production.

Purpose

This skill covers hardening a CometChat Android integration for production: replacing client-side Auth Key with server-side token generation, user management CRUD, ProGuard/R8 rules, and security best practices.


Use this skill when

  • "Set up production auth"
  • "Replace Auth Key with tokens"
  • "ProGuard is breaking CometChat"
  • "How do I create CometChat users from my backend?"

Do not use this skill when

  • Setting up dev-mode login → use cometchat-android-v5-core
  • Adding features → use cometchat-android-v5-features

1. Why production auth matters

In dev mode, CometChatUIKit.login(uid) uses the Auth Key embedded in your app. Anyone can decompile the APK, extract the key, and login as ANY user. Production deployments MUST use server-side token generation.

2. Token auth flow

Client → Your Server → CometChat REST API → auth token → Client
Client calls CometChatUIKit.loginWithAuthToken(token)

Your server calls: POST https://{APP_ID}.api-{REGION}.cometchat.io/v3/users/{uid}/auth_tokens with headers: appId, apiKey (REST API Key, NOT Auth Key).

3. Client-side implementation

Java:

// Fetch token from YOUR backend
String token = fetchTokenFromYourServer(currentUserId);

CometChatUIKit.loginWithAuthToken(token, new CometChat.CallbackListener<User>() {
    @Override
    public void onSuccess(User user) {
        // Navigate to chat
    }
    @Override
    public void onError(CometChatException e) {
        // Handle error
    }
});

4. ProGuard/R8 rules

Add to proguard-rules.pro:

-keep class com.cometchat.** { *; }
-keep class com.cometchat.chatuikit.** { *; }
-dontwarn com.cometchat.**

5. Security checklist

  • Auth Key removed from client code
  • REST API Key stored server-side only
  • loginWithAuthToken() used instead of login(uid)
  • ProGuard rules added
  • Network security config allows CometChat domains
  • Push token unregistered on logout

Hard rules

  • Never ship Auth Key in production APKs. Use loginWithAuthToken().
  • REST API Key ≠ Auth Key. REST API Key is server-only. Auth Key is client-side dev-only.
  • Add ProGuard keep rules. R8 can strip CometChat classes needed at runtime.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/cometchat-cometchat-skills-cometchat-android-v5-production/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

cometchat-cometchat-skills-cometchat-android-v5-production.ocm.jsonjson
{
  "ocm": "1",
  "id": "cometchat-cometchat-skills-cometchat-android-v5-production",
  "kind": "skill",
  "name": "cometchat-android-v5-production",
  "description": "Production readiness for CometChat Android — server-side token auth, user management CRUD, ProGuard rules, and security checklist.",
  "publisher": "cometchat",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "cometchat",
      "android",
      "production",
      "auth",
      "token",
      "security",
      "user-management",
      "proguard",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Production readiness for CometChat Android — server-side token auth, user management CRUD, ProGuard rules, and security checklist."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/cometchat/cometchat-skills",
      "path": "skills/cometchat-android-v5-production/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/cometchat/cometchat-skills/blob/HEAD/skills/cometchat-android-v5-production/SKILL.md",
      "key": "cometchat/cometchat-skills/skills/cometchat-android-v5-production/SKILL.md"
    },
    "compatibility": "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x",
    "license": "MIT"
  },
  "instructions": "> **Ground truth:** `com.cometchat:chat-uikit-android:5.x` (legacy/maintenance-only; +`calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android`. **Official docs:** https://www.cometchat.com/docs/fundamentals/user-auth · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.\n\n> **Companion skills:** `cometchat-android-v5-core` covers dev-mode login;\n> `cometchat-android-v5-push` covers push notification setup for production.\n\n##",
  "cost": {
    "context_tokens": 714
  }
}

Fetch it by URL: GET /api/v1/registry/cometchat-cometchat-skills-cometchat-android-v5-production/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.