Generate correct Sendbird connection/session code — direct connect, session-token issue/refresh, multi-device, reauth, safe logout — for the detected platform/host. Auth is part of Chat. Use when the customer asks about authentication, session tokens, or login/logout flows.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Auth Recipes?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sendbird-auth-recipes)
---
name: auth-recipes
description: Generate correct Sendbird connection/session code — direct connect, session-token issue/refresh, multi-device, reauth, safe logout — for the detected platform/host. Auth is part of Chat. Use when the customer asks about authentication, session tokens, or login/logout flows.
argument-hint: "<flow: session-token|multi-device|reauth|logout>"
allowed-tools: Read, Edit, Write, Bash, Grep, Glob, WebFetch, Agent
---
# /sendbird-client:auth-recipes
Connection/session flows (a Chat capability).
Resolve every plugin-owned path below from `${CLAUDE_PLUGIN_ROOT}`. Where that variable is empty (Codex does not set it for shell commands), the plugin root is the folder two levels above this SKILL.md. A shell command that only reads or checks files exits 0 when a file it looks for is missing (`if [ -f <file> ]; then cat <file>; fi`, or `|| true` after an optional read), and quotes separator lines (`echo '=== name'`: zsh, the default macOS shell, treats a word that starts with `=` as a command name). Otherwise a normal check is shown to the customer as a failed command.
Resolve the platform agent with `bash "${CLAUDE_PLUGIN_ROOT}/tools/routing/route-agent.sh" <project-dir> code`. Hand work to that agent by calling the `Agent` tool once with the agent as Claude Code lists it: this plugin's name, a colon, then the name the router printed (for example `sendbird-client:sendbird-ios-agent`). In Codex, which has no `Agent` tool, run that agent's launcher skill instead (for example `$sendbird-client:sendbird-ios-agent`) and start the agent only as that skill says; it sets the model and settings the agent needs. Do not do the agent's part yourself, even in a small project: write or edit no project source file in this session, before or after the hand-off, also when the customer confirms a change in a later turn. If the hand-off fails, say that this part was not done. When the agent reports, your final answer carries its changed files, every check line, and its symbol, source, and version table as the agent wrote them (`docs/AGENT_CONTRACT.md` section 6); shorten the wording only. In an answer in another language each check line still starts with the check's name as the agent wrote it (`- dependency: pass, package.json:12`); translate only the words after it.
Before anything else, check every product the request names (`chat`, `uikit`, `calls`, `desk`, or `live`; a Sendbird product outside that list is not covered by this plugin, so change nothing for it and tell the customer) with `bash "${CLAUDE_PLUGIN_ROOT}/tools/detection/resolve-products.sh" <project-dir> --check <product>`, one run per product. Printing the scope without `--check` is not this check. When it exits 1, change nothing and hand nothing to an agent: say what it printed. Only for "out of configured scope" add that `SENDBIRD_PRODUCTS` or `enabledProducts` in `.sendbird-client/profile.json` sets the scope; for "not available on this host" give the reason it printed and never suggest those settings, which cannot change it; a non-interactive run ends with `status: "declined"`.
## Steps
1. Run `bash "${CLAUDE_PLUGIN_ROOT}/tools/detection/detect.sh" <project-dir>` and `bash "${CLAUDE_PLUGIN_ROOT}/tools/detection/resolve-products.sh" <project-dir>`, then inspect the customer code and installed SDK surface for direct-connect or session-token handling. Ask once if the code does not establish the current auth posture; in a non-interactive run, do not ask and use the defaults in `docs/AGENT_CONTRACT.md` section 7.
- If the customer names an auth scheme that `knowledge/curated/<platform>/products/auth.md` does not cover (for example JWT or OAuth), say it was not found, list the places checked (`auth.md`, the installed SDK surface, `core/docs-index.json`), and ask what token the app has today. Do not offer an unverified Sendbird option for it.
2. Read `knowledge/curated/<platform>/products/auth.md` for the requested flow and the session-expiry codes in `knowledge/curated/<platform>/cross-cutting/errors.md` before handing off. Then hand off to the platform agent to produce the verified pattern (session delegate/handler, token refresh, safe disconnect) from the wired sources below, passing the sections and codes you read. The brief names, word for word: the template file for the detected host from "Templates" below, which the agent starts from and whose `source:` comment it keeps at the top of the file it writes; and each session-expiry code (400309, 400310) with its `errors.md` line, which the agent's report cites next to the session handler or delegate. The final answer repeats both: the template path in the source table and the codes with their `errors.md` lines. An answer without them does not finish this skill. The token itself comes from the customer's server: leave one app function that fetches it and list the token server under `manualSteps`, instead of stopping to ask for server details. That function hard-codes no token and names no URL or endpoint the project does not already have, so it is not the placeholder endpoint that `docs/AGENT_CONTRACT.md` section 3 rules out.
3. Note Sendbird Dashboard config requirements (link docs, don't invent paths).
## Wired knowledge (populated and cited)
- Flows + symbols: `knowledge/curated/<platform>/products/auth.md` — session-token connect, refresh (`SessionDelegate` iOS / `SessionHandler` Android+JS, registered BEFORE connect), reauth, multi-device, logout. Pinned and latest templates compile or type-check on all three platforms.
- Templates, one per host: iOS UIKit `templates/ios/uikit/auth/SessionAuth.swift`, iOS SwiftUI `templates/ios/swiftui/auth/AuthSession.swift`, Android View `templates/android/view/auth/SessionAuth.kt`, Android Compose `templates/android/compose/auth/AuthViewModel.kt`, React `templates/js/react/auth/session.ts`, React Native `templates/js/react-native/auth/session.ts`.
- JS UIKit hosts: `knowledge/curated/js/products/uikit.md` "Session tokens: `accessToken` and `configureSession`" (React) and "Session tokens: `connect(userId, { accessToken })` and `onInitialized`" (React Native). A React app that renders the drop-in `App` cannot renew a token; when its tokens can expire, replace `App` with `templates/js/react/uikit/SignedInChat.tsx` and the granular components.
- Session-expiry error codes: per-platform `knowledge/curated/<platform>/cross-cutting/errors.md` (e.g. 400309/400310).
## No-Fabrication
Session-delegate/handler symbols + token APIs must be verified + cited. Never invent an auth API. Unverified -> "I don't know — here's what I checked".