{"id":"223072d0-f93f-49d6-8da8-45a590aaef62","shortId":"5QPcP6","kind":"skill","title":"cometchat-android-v6-production","tagline":"CometChat Android UIKit v6 production readiness — token auth, ProGuard/R8, security checklist, release configuration","description":"> **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-builder-settings (UIKitSettings), cometchat-android-v6-push (FCM)\n\n## Purpose\n\nPrepare a CometChat v6 Android app for production release — switch to token-based auth, configure ProGuard/R8, apply security best practices, and optimize the release build.\n\n## Use this skill when\n\n- Preparing an app for production/release\n- Switching from authKey to token-based authentication\n- Configuring ProGuard/R8 rules for CometChat\n- Reviewing security best practices\n\n## Do not use this skill when\n\n- Setting up for development (use `cometchat-android-v6-core`)\n- Debugging issues (use `cometchat-android-v6-troubleshooting`)\n\n## 1. Token-Based Authentication\n\n### 1.1 Never Ship authKey\n\n```kotlin\n// ❌ NEVER in production\nval settings = UIKitSettings.UIKitSettingsBuilder()\n    .setAppId(\"APP_ID\")\n    .setRegion(\"us\")\n    .setAuthKey(\"AUTH_KEY\") // REMOVE THIS\n    .build()\n\nCometChatUIKit.login(\"uid\", callback) // Uses authKey internally\n\n// ✅ Production pattern\nval settings = UIKitSettings.UIKitSettingsBuilder()\n    .setAppId(\"APP_ID\")\n    .setRegion(\"us\")\n    // No authKey\n    .build()\n\n// Get token from your backend server\nval authToken = yourServer.getAuthToken(userId)\nCometChatUIKit.loginWithAuthToken(authToken, callback)\n```\n\n### 1.2 Server-Side Token Generation\n\nYour backend generates auth tokens using the CometChat REST API:\n- Endpoint: `POST https://{appId}.api-{region}.cometchat.io/v3/users/{uid}/auth_tokens`\n- Header: `apiKey: YOUR_API_KEY` (server-side only)\n\nThe auth token is then passed to the client for `loginWithAuthToken()`.\n\n## 2. ProGuard / R8 Configuration\n\n### 2.1 Consumer Rules\n\nCometChat UIKit modules include `consumer-rules.pro` that are automatically applied. Check that your app's `build.gradle.kts` has:\n\n```kotlin\nandroid {\n    buildTypes {\n        release {\n            isMinifyEnabled = true\n            proguardFiles(\n                getDefaultProguardFile(\"proguard-android-optimize.txt\"),\n                \"proguard-rules.pro\"\n            )\n        }\n    }\n}\n```\n\n### 2.2 Additional ProGuard Rules\n\nIf you encounter issues with minification, add these rules:\n\n```proguard\n# CometChat SDK\n-keep class com.cometchat.chat.** { *; }\n-keep class com.cometchat.calls.** { *; }\n\n# CometChat UIKit\n-keep class com.cometchat.uikit.** { *; }\n\n# Gson (used for FCM DTO parsing)\n-keep class com.google.gson.** { *; }\n-keepattributes Signature\n-keepattributes *Annotation*\n\n# Firebase\n-keep class com.google.firebase.** { *; }\n```\n\n## 3. Security Checklist\n\n| Item | Status | Notes |\n|---|---|---|\n| Remove `authKey` from client code | Required | Use `loginWithAuthToken()` |\n| Store `appId` securely | Recommended | Use BuildConfig or encrypted prefs |\n| Use HTTPS for all custom endpoints | Required | `overrideAdminHost` / `overrideClientHost` |\n| Validate auth tokens server-side | Required | Tokens should expire |\n| Do not log sensitive data | Required | Remove debug logs in release |\n| Enable R8/ProGuard | Recommended | Obfuscates code |\n| Pin SSL certificates | Optional | For high-security apps |\n\n## 4. Release Build Configuration\n\n```kotlin\nandroid {\n    compileSdk = 36\n\n    defaultConfig {\n        minSdk = 28\n        targetSdk = 36\n    }\n\n    buildTypes {\n        release {\n            isMinifyEnabled = true\n            isShrinkResources = true\n            proguardFiles(\n                getDefaultProguardFile(\"proguard-android-optimize.txt\"),\n                \"proguard-rules.pro\"\n            )\n        }\n    }\n\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_11\n        targetCompatibility = JavaVersion.VERSION_11\n    }\n\n    kotlinOptions {\n        jvmTarget = \"11\"\n    }\n}\n```\n\n## 5. Dependency Management\n\n### 5.1 Compose BOM\n\nFor Compose stack, use the BOM to align Compose library versions:\n\n```kotlin\nimplementation(platform(\"androidx.compose:compose-bom:2024.x.x\"))\nimplementation(\"androidx.compose.ui:ui\")\nimplementation(\"androidx.compose.material3:material3\")\n```\n\n### 5.2 Version Pinning\n\nPin CometChat SDK versions explicitly:\n\n```kotlin\nimplementation(\"com.cometchat:chatuikit-compose-android:6.0.0-beta2\")\n// or\nimplementation(\"com.cometchat:chatuikit-kotlin-android:6.0.0-beta2\")\n```\n\n## 6. minSdk 28 Implications\n\nv6 requires `minSdk = 28` (Android 9.0 Pie). This means:\n- No support for Android 7.0-8.1 devices\n- Full TLS 1.3 support\n- Native BiometricPrompt API available\n- Adaptive icons required\n\n## Hard rules\n\n- NEVER ship `authKey` in production builds — it allows anyone to create users and login\n- ALWAYS use `loginWithAuthToken()` with server-generated tokens in production\n- ALWAYS test the release build with ProGuard/R8 enabled before shipping — CometChat uses reflection in some areas\n- `minSdk` must be 28 — do NOT lower it, v6 APIs depend on API 28+ features\n- Remove all `Log.d()` / debug logging in release builds — use `BuildConfig.DEBUG` guards","tags":["cometchat","android","production","skills","agent-skills","ai-agent","chat","claude-code","cursor","messaging","nextjs","react"],"capabilities":["skill","source-cometchat","skill-cometchat-android-v6-production","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-android-v6-production","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 (4,934 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:47.276Z","embedding":null,"createdAt":"2026-05-07T13:05:06.527Z","updatedAt":"2026-05-18T19:04:47.276Z","lastSeenAt":"2026-05-18T19:04:47.276Z","tsv":"'-8.1':476 '/auth_tokens':201 '/v3/users/':199 '1':117 '1.1':122 '1.2':176 '1.3':480 '11':392,395,398 '2':222 '2.1':226 '2.2':255 '2024':423 '28':376,460,465,534,544 '3':299 '36':373,378 '4':366 '5':399 '5.1':402 '5.2':432 '6':458 '6.0.0':447,456 '7.0':475 '9.0':467 'adapt':486 'add':265 'addit':256 'align':412 'allow':498 'alway':505,515 'android':3,7,23,29,36,45,106,114,246,371,446,455,466,474 'androidx.compose':419,429 'androidx.compose.ui':426 'annot':294 'anyon':499 'api':191,195,205,484,540,543 'apikey':203 'app':46,73,134,156,241,365 'appid':194,314 'appli':58,237 'area':530 'auth':13,55,139,185,212,332 'authent':83,121 'authkey':78,125,148,161,306,493 'authtoken':170,174 'automat':236 'avail':485 'backend':167,183 'base':54,82,120 'best':60,91 'beta2':448,457 'biometricprompt':483 'bom':404,410,422 'build':66,143,162,368,496,519,553 'build.gradle.kts':243 'buildconfig':318 'buildconfig.debug':555 'builder':31 'buildtyp':247,379 'callback':146,175 'certif':359 'chatuikit':444,453 'chatuikit-compose-android':443 'chatuikit-kotlin-android':452 'check':238 'checklist':16,301 'class':272,275,280,289,297 'client':219,308 'code':309,356 'com.cometchat':442,451 'com.cometchat.calls':276 'com.cometchat.chat':273 'com.cometchat.uikit':281 'com.google.firebase':298 'com.google.gson':290 'cometchat':2,6,22,28,35,43,88,105,113,189,229,269,277,436,525 'cometchat-android-v6-builder-settings':27 'cometchat-android-v6-core':21,104 'cometchat-android-v6-production':1 'cometchat-android-v6-push':34 'cometchat-android-v6-troubleshooting':112 'cometchat.io':198 'cometchat.io/v3/users/':197 'cometchatuikit.login':144 'cometchatuikit.loginwithauthtoken':173 'companion':19 'compileopt':389 'compilesdk':372 'compos':403,406,413,421,445 'compose-bom':420 'configur':18,56,84,225,369 'consum':227 'consumer-rules.pro':233 'core':25,108 'creat':501 'custom':326 'data':345 'debug':109,348,549 'defaultconfig':374 'depend':400,541 'develop':102 'devic':477 'dto':286 'enabl':352,522 'encount':261 'encrypt':320 'endpoint':192,327 'expir':340 'explicit':439 'fcm':39,285 'featur':545 'firebas':295 'full':478 'generat':181,184,511 'get':163 'getdefaultproguardfil':252,386 'gson':282 'guard':556 'hard':489 'header':202 'high':363 'high-secur':362 'https':323 'icon':487 'id':135,157 'implement':417,425,428,441,450 'implic':461 'includ':232 'init/login':26 'intern':149 'isminifyen':249,381 'isshrinkresourc':383 'issu':110,262 'item':302 'javaversion.version':391,394 'jvmtarget':397 'keep':271,274,279,288,296 'keepattribut':291,293 'key':140,206 'kotlin':126,245,370,416,440,454 'kotlinopt':396 'librari':414 'log':343,349,550 'log.d':548 'login':504 'loginwithauthtoken':221,312,507 'lower':537 'manag':401 'material3':430,431 'mean':470 'minif':264 'minsdk':375,459,464,531 'modul':231 'must':532 'nativ':482 'never':123,127,491 'note':304 'obfusc':355 'optim':63 'option':360 'overrideadminhost':329 'overrideclienthost':330 'pars':287 'pass':216 'pattern':151 'pie':468 'pin':357,434,435 'platform':418 'post':193 'practic':61,92 'pref':321 'prepar':41,71 'product':5,10,48,129,150,495,514 'production/release':75 'proguard':223,257,268 'proguard-android-optimize.txt':253,387 'proguard-rules.pro':254,388 'proguard/r8':14,57,85,521 'proguardfil':251,385 'purpos':40 'push':38 'r8':224 'r8/proguard':353 'readi':11 'recommend':316,354 'reflect':527 'region':196 'releas':17,49,65,248,351,367,380,518,552 'remov':141,305,347,546 'requir':310,328,337,346,463,488 'rest':190 'review':89 'rule':86,228,258,267,490 'sdk':270,437 'secur':15,59,90,300,315,364 'sensit':344 'server':168,178,208,335,510 'server-gener':509 'server-sid':177,207,334 'set':32,99,131,153 'setappid':133,155 'setauthkey':138 'setregion':136,158 'ship':124,492,524 'side':179,209,336 'signatur':292 'skill':20,69,97 'skill-cometchat-android-v6-production' 'source-cometchat' 'sourcecompat':390 'ssl':358 'stack':407 'status':303 'store':313 'support':472,481 'switch':50,76 'targetcompat':393 'targetsdk':377 'test':516 'tls':479 'token':12,53,81,119,164,180,186,213,333,338,512 'token-bas':52,80,118 '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' 'troubleshoot':116 'true':250,382,384 'ui':427 'uid':145,200 'uikit':8,230,278 'uikitset':33 'uikitsettings.uikitsettingsbuilder':132,154 'us':137,159 'use':67,95,103,111,147,187,283,311,317,322,408,506,526,554 'user':502 'userid':172 'v6':4,9,24,30,37,44,107,115,462,539 'val':130,152,169 'valid':331 'version':415,433,438 'x.x':424 'yourserver.getauthtoken':171","prices":[{"id":"f8139549-7263-4fc1-8722-519c73e7205a","listingId":"223072d0-f93f-49d6-8da8-45a590aaef62","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-07T13:05:06.527Z"}],"sources":[{"listingId":"223072d0-f93f-49d6-8da8-45a590aaef62","source":"github","sourceId":"cometchat/cometchat-skills/cometchat-android-v6-production","sourceUrl":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-android-v6-production","isPrimary":false,"firstSeenAt":"2026-05-07T13:05:06.527Z","lastSeenAt":"2026-05-18T19:04:47.276Z"}],"details":{"listingId":"223072d0-f93f-49d6-8da8-45a590aaef62","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"cometchat","slug":"cometchat-android-v6-production","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":"817dffdcad83ed2a7f5b740ba972aed6dfff65ea","skill_md_path":"skills/cometchat-android-v6-production/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-android-v6-production"},"layout":"multi","source":"github","category":"cometchat-skills","frontmatter":{"name":"cometchat-android-v6-production","license":"MIT","description":"CometChat Android UIKit v6 production readiness — token auth, ProGuard/R8, security checklist, release configuration","compatibility":"Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"},"skills_sh_url":"https://skills.sh/cometchat/cometchat-skills/cometchat-android-v6-production"},"updatedAt":"2026-05-18T19:04:47.276Z"}}