AGENT SKILL

cometchat-flutter-v6-production

Take a CometChat Flutter integration to production — server-minted auth tokens instead of the Auth Key, secret handling in a Flutter bundle, logout/session hygiene, release build config, and the pre-ship checklist. Triggers: 'production auth cometchat', 'auth token flutter', 'is the auth key safe', 'ship cometchat to production', 'release build cometchat'.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 1.6k
Forks
491

01 前言 Front Matter

name
cometchat-flutter-v6-production
license
MIT
metadata
{ "tags": "cometchat flutter production auth-token security release v6", "author": "CometChat", "version": "1.0.0" }
description
Take a CometChat Flutter integration to production — server-minted auth tokens instead of the Auth Key, secret handling in a Flutter bundle, logout/session hygiene, release build config, and the pre-ship checklist. Triggers: 'production auth cometchat', 'auth token flutter', 'is the auth key safe', 'ship cometchat to production', 'release build cometchat'.
compatibility
Flutter >=3.38.9; cometchat_chat_uikit ^6.2.0 (6.2.x; catalog compiler-verified vs 6.1.0, source-checked vs 6.2.0); cometchat_sdk ^5.0.8

03 SKILL.md 正文

Ground truth: loginWithAuthToken and logout are catalog-verified against 6.1.0. Token MINTING is a server-side REST call — its exact endpoint is FETCHED from the REST API docs, never guessed. The dev-vs-prod credential rule is RULES.md §4.

Companion skills (read first)

  • cometchat-flutter-v6-core — install, credentials, init→login→render, lifecycle.md. This skill ASSUMES it.
  • cometchat-flutter-v6-patterns — where config comes from in your build pipeline.
  • cometchat-security — the enterprise auth model this client-side hardening plugs into: wiring your IdP / SSO into the token flow (your IdP → your server → mint the CometChat auth token; CometChat is not an IdP), token expiry/refresh + re-login, RBAC roles + group (SBAC) scopes, and Auth Key vs auth token vs REST API Key. Load it for a security review or any SSO question.

Use this skill when

Hardening before release: "is the Auth Key safe to ship", "set up production auth", "what do I check before shipping".

Prerequisites & install

Core done. No new package.

The one thing that actually matters: the Auth Key must not ship

An Auth Key can log in as ANY user of your app. Everything core writes for development puts it in cometchat-settings.json, which is bundled into the APK/IPA — and a bundle is not a secret. Anyone can extract it.

Development (what core wired): credentials.authKey in the settings asset → CometChatUIKit.login(uid). Fine for building; never for release.

Production (what you must move to):

  1. Your server mints a per-user auth token by calling CometChat's REST API with the REST API Key (which stays on the server, never in the app).
  2. Your app authenticates the user your normal way, then asks YOUR backend for that token.
  3. The app signs in with the token:
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';

Future<void> signIn(String authTokenFromYourServer) async {
  await CometChatUIKit.loginWithAuthToken(
    authTokenFromYourServer,
    onSuccess: (User user) {},
    onError: (CometChatException e) {},
  );
}
  1. Remove credentials.authKey from the shipped settings file. Confirm by unzipping the release artifact and grepping for the key — do not take it on trust.

Fetch the exact token-minting endpoint from the REST API docs (../cometchat-flutter-v6-core/references/docs-map.md → SDK/REST). Never invent a URL or payload.

Session hygiene

  • Log out properly — CometChatUIKit.logout() on your app's sign-out, and unregister the push token FIRST (-push), or the next user of the device receives the previous user's notifications.
  • One user per session. login no-ops if that UID is already signed in, but switching users requires an explicit logout first.
  • Token expiry — a server-minted token can expire; handle the login error by refetching from your backend rather than falling back to the Auth Key.

Release build config

  • Android — minSdk 26 (the docs' 24 is too low — the kit's cometchat_calls_sdk dependency pins 26); INTERNET permission; calling adds camera/mic. If you use R8/ProGuard, verify the kit still works in a release build, not just debug.
  • iOS — deployment target per the docs; usage-description strings for camera/mic/photos, or the OS kills the app on first use.
  • Settings asset — a registered asset, so NOT gitignored (a fresh clone / CI flutter build fails with "No file or variants found for asset"): commit a placeholder (no real Auth Key) and have CI overwrite it at build time with the prod-flavoured file (no Auth Key).
  • Flavors — dev and prod should point at different CometChat apps; do not test against production data.

Pre-ship checklist

  1. No Auth Key in the release artifact (verified by inspection, not assumption).
  2. loginWithAuthToken is the only login path in prod code.
  3. Logout clears the session and unregisters push.
  4. Permission strings present on both platforms.
  5. Release build (obfuscated) actually runs — chat renders, messages send.
  6. Tested against the prod CometChat app, on real devices.
  7. Errors surface to the user rather than being swallowed in an empty onError.

Common pitfalls (BAKED)

  • Shipping the Auth Key — the single most serious mistake here.
  • Assuming --dart-define is a secret — it is compiled into the binary, same exposure.
  • Only testing debug builds — obfuscation/minification problems appear only in release.
  • No logout path → the session persists across users on a shared device.
  • Swallowing onError → a production auth failure looks like a blank screen.
  • Minting tokens in the app — that needs the REST key, which must never be in the client.

Verify it works

The release artifact contains no Auth Key; sign-in goes through your backend; sign-out clears the session and push; a release build on a real device sends and receives; an expired token produces a clean re-auth rather than a blank screen.

04 同仓库更多 Skills

hashgraph-online
hashgraph-online/awesome-codex-plugins

migrate-to-e2e

Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

e2e

Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

create-verification-skill

Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-search

deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-reflect

End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

revid

Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.

图像与多媒体Skill与智能体开发
★ 1.6k