cometchat/cometchat-uikit-flutter/cometchat-flutter-production
Claude Code and agent skill by cometchat/cometchat-uikit-flutter
- community
Checking that the SKILL.md file is still in the repository.
Production readiness for CometChat Flutter UIKit v6 — server-side auth tokens, user management, Android ProGuard/R8, iOS Info.plist, minSdk, release build checklist, environment configuration, and security hardening. Use when preparing a CometChat Flutter app for production deployment.
Install
npx vskill@latest install cometchat/cometchat-uikit-flutter/cometchat-flutter-productionSKILL.md
The same SKILL.md was published earlier as cometchat/cometchat-uikit-flutter/cometchat-flutter-production.
CometChat Flutter UIKit v6 — Production Readiness
Everything you need to move a CometChat Flutter app from development to production. Covers authentication, platform configuration, environment management, and security hardening.
1. Dev Mode vs Production
CometChat supports two authentication modes. Understanding the difference is critical before shipping.
Dev Mode (authKey — development only)
The authKey is embedded in client code and lets any user log in by UID alone. Convenient for prototyping, but anyone who decompiles your app can impersonate any user.
Production Mode (authToken — server-minted)
Your backend generates a short-lived authToken for each authenticated user. The client never sees the authKey.
Rule: If authKey appears anywhere in your production build, you have a security vulnerability.
2. Server-Side Auth Token Flow
How It Works
Step 1: Your Backend Generates the Token
Your server calls the CometChat REST API with the authKey (which stays server-side):
Response:
Replace API_REGION with your region endpoint:
- US:
api-us.cometchat.io - EU:
api-eu.cometchat.io - IN:
api-in.cometchat.io
Step 2: Your Backend Returns the Token to the Client
Your Flutter app calls your own backend (after the user authenticates with your auth system), and your backend returns the CometChat authToken.
Step 3: Flutter Client Logs In with the Token
Note: loginWithAuthToken populates CometChatUIKit.loggedInUser before calling onSuccess — same as login() and init(). No need to call getLoggedInUser() afterward.
Note: When a user is already logged in, loginWithAuthToken calls onSuccess only for the auth token the SDK already holds. Any other token gets onError with ERR_USER_ALREADY_LOGGED_IN and returns null: check CometChatUIKit.loggedInUser first, and call CometChatUIKit.logout() before logging in as someone else.
3. User Management
Creating Users
Updating Users
Production Warning
createUser() and updateUser() require the authKey (set in UIKitSettings). In production:
- Move user creation to your backend — call the CometChat REST API server-side
- Move user updates to your backend — same approach
- The Flutter client should only call
loginWithAuthToken()— never create or update users directly
Server-side user creation:
4. Android Build Requirements
These are required for CometChat UIKit v6 on Android. Without them, debug builds may work but release builds will crash.
gradle.properties
Ensure these are in android/gradle.properties:
enableJetifier resolves old Android Support Library conflicts from transitive dependencies in the CometChat SDK.
minSdk 26
In android/app/build.gradle (Groovy) or build.gradle.kts (Kotlin DSL):
If your minSdk is lower than 26, the build will fail with a manifest merger error referencing cometchat_calls_sdk.
ProGuard / R8 Keep Rules
Create android/app/proguard-rules.pro with these exact contents:
Reference the ProGuard file in your release build type. In android/app/build.gradle.kts:
Or in android/app/build.gradle (Groovy):
Without these rules, release builds crash with `ClassNotFoundException` for CometChat classes. Debug builds work fine because R8/ProGuard only runs on release.
Multidex (if targeting API < 21 elsewhere)
CometChat requires minSdk 26, so multidex is not needed (it's automatic above API 21). If you have a multi-module setup where another module targets lower, ensure the app module still sets minSdk = 26.
5. iOS Build Requirements
Info.plist Permissions
Add these to ios/Runner/Info.plist inside the top-level <dict>:
Without these, the app crashes when the user taps the camera/gallery/mic button — iOS terminates apps that access protected APIs without a usage description.
VoIP Background Mode (for CallKit)
If using CometChat calling with CallKit (incoming call notifications when app is backgrounded), add to Info.plist:
Or enable via Xcode: Target → Signing & Capabilities → + Background Modes → check "Voice over IP" and "Remote notifications".
App Transport Security
CometChat uses HTTPS by default, so no ATS exceptions are needed. If you're loading user avatars or media from HTTP URLs (not recommended), add:
Avoid this in production — it disables all transport security. Instead, ensure all media URLs use HTTPS.
Minimum iOS Deployment Target
In ios/Podfile, ensure:
CometChat UIKit v6 requires iOS 13.0+. If your Podfile has a lower target, pod install will fail.
6. Environment Configuration
Never hardcode credentials in source code. The AppCredentials pattern used in development:
Option A: Dart Defines (recommended for simple setups)
Pass credentials at build time:
Read them in code:
For release builds:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cometchat-flutter-production/SKILL.md
Popularity
- Repository stars
- 520
- Repository forks
- 42
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cometchat/cometchat-uikit-flutter/cometchat-flutter-production)