TencentCloudBase/CloudBase-AI-Toolkit/config/source/skills/auth-web-cloudbase/SKILL.md
auth-web-cloudbase
CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.
- Source repository stars
- 1,066
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-04
- Source checked
- 2026-08-04
Decision brief
What it does—and where it fits
If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/TencentCloudBase/CloudBase-AI-Toolkit --skill "config/source/skills/auth-web-cloudbase"Inspect the Agent Skill "auth-web-cloudbase" from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/blob/1dddc898085c55ae616c3b0bf989b4b7b7797b35/config/source/skills/auth-web-cloudbase/SKILL.md at commit 1dddc898085c55ae616c3b0bf989b4b7b7797b35. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Quick Start
If the current task has not retrieved a real Publishable Key, omit accessKey instead of inventing one. A wrong accessKey can break auth-state checks and protected-route behavior.
If the current task has not retrieved a real Publishable Key, omit accessKey instead of inventing one. A wrong accessKey can break auth-state checks and protected-route behavior. - 02
Standalone Install Note
If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.
CloudBase main entry: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.mdCurrent skill raw source: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-web-cloudbase/SKILL.mdIf this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills. - 03
Activation Contract
Note: anonymous login is now disabled by default for new environments and inactive existing environments. Always use auth.getSession() for auth guards.
The task is a CloudBase Web login, registration, session, or user profile flow built with @cloudbase/js-sdk and the auth provider setup has already been checked.The user needs a login page, auth modal, session handling, or protected Web route. Read auth-tool-cloudbase first to ensure providers are enabled, then return here for frontend integration.../auth-tool-cloudbase/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-tool-cloudbase/SKILL.md) for provider setup - 04
Use this first when
The task is a CloudBase Web login, registration, session, or user profile flow built with @cloudbase/js-sdk and the auth provider setup has already been checked.
The task is a CloudBase Web login, registration, session, or user profile flow built with @cloudbase/js-sdk and the auth provider setup has already been checked.- The task is a CloudBase Web login, registration, session, or user profile flow built with @cloudbase/js-sdk and the auth provider setup has already been checked. - 05
Read before writing code if
The user needs a login page, auth modal, session handling, or protected Web route. Read auth-tool-cloudbase first to ensure providers are enabled, then return here for frontend integration.
The user needs a login page, auth modal, session handling, or protected Web route. Read auth-tool-cloudbase first to ensure providers are enabled, then return here for frontend integration.- The user needs a login page, auth modal, session handling, or protected Web route. Read auth-tool-cloudbase first to ensure providers are enabled, then return here for frontend integration.
Permission review
Static risk signals and limitations
Network access
The documentation includes network, browsing, or remote request actions.
The request is a Web auth flow but provider configuration has not been verified yet.Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 88/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 1,066 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- TencentCloudBase/CloudBase-AI-Toolkit
- Skill path
- config/source/skills/auth-web-cloudbase/SKILL.md
- Commit
- 1dddc898085c55ae616c3b0bf989b4b7b7797b35
- License
- MIT
- Collected
- 2026-08-04
- Default branch
- main
View the original SKILL.md
Standalone Install Note
If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.
- CloudBase main entry:
https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md - Current skill raw source:
https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-web-cloudbase/SKILL.md
Keep local references/... paths for files that ship with the current skill directory. When this file points to a sibling skill such as auth-tool-cloudbase or web-development, use the standalone fallback URL shown next to that reference.
Activation Contract
Use this first when
- The task is a CloudBase Web login, registration, session, or user profile flow built with
@cloudbase/js-sdkand the auth provider setup has already been checked.
Read before writing code if
- The user needs a login page, auth modal, session handling, or protected Web route. Read
auth-tool-cloudbasefirst to ensure providers are enabled, then return here for frontend integration.
Then also read
../auth-tool-cloudbase/SKILL.md(standalone fallback:https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-tool-cloudbase/SKILL.md) for provider setup../web-development/SKILL.md(standalone fallback:https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/web-development/SKILL.md) for Web project structure and deployment
Do not start here first when
- The request is a Web auth flow but provider configuration has not been verified yet.
- In that case, activate
auth-tool-cloudbasebeforeauth-web-cloudbase.
Do NOT use for
- Mini program auth, native App auth, or server-side auth setup.
Common mistakes / gotchas
-
Skipping publishable key and provider checks.
-
Replacing built-in Web auth with cloud function login logic.
-
Reusing this flow in Flutter, React Native, or native iOS/Android code.
-
Creating a detached helper file with
auth.signUp/verifyOtpbut never wiring it into the existing form handlers, so the actual button clicks still do nothing. -
Using
signInWithEmailAndPasswordorsignUpWithEmailAndPasswordfor username-style accounts such asadminandeditor. -
Keeping the login or register account input as
type="email"when the task explicitly says the account identifier is a plain username string. -
Starting implementation before calling
queryAppAuth(action="getLoginConfig")and enablingusernamePasswordwhen it is still off. -
Writing
auth.signInWithPassword(...)orauth.signUp(...)code without first confirming the provider is enabled via MCP. Before writing any sign-in or sign-up code in the browser, callqueryAppAuth(action="listProviders")to verify the target provider (e.g.email,phone,usernamePassword) hasOn: "TRUE". For email-based sign-up (auth.signUp({ email, password })), additionally confirm SMTP is configured — otherwise the provider may throw"provider email not found"or similar errors. For username/password login, useauth.signInWithPassword({ username, password }); registration is best done through the management API (manageAppAuth(action="createUser")) or by confirming email provider readiness first. -
Treating
auth.getUser()or deprecatedauth.getLoginState()as proof of real login. When the SDK is initialized withaccessKey, the deprecatedgetLoginState()returns an object with a validuideven without any login — causing route guards that check!!loginStateor!!uidto incorrectly pass. The fix is to useauth.getSession()instead: it returnsdata.session === undefinedwhen no real login has occurred. Only!!data.sessionfromgetSession()is a reliable authentication check. -
Copying old CloudBase auth snippets from training data. Do not use
auth.getLoginState(),auth.hasLoginState(),auth.getCurrentUser(), orauth.toDefaultLoginPage()as the default Web flow. Use the Web SDK v3 auth methods in this file and provider readiness fromauth-tool-cloudbase.Note: anonymous login is now disabled by default for new environments and inactive existing environments. Always use
auth.getSession()for auth guards.
Overview
Prerequisites: CloudBase environment ID (env)
Prerequisites: CloudBase environment Region (region)
Core Capabilities
Use Case: Web frontend projects using @cloudbase/js-sdk@latest for user authentication
Key Benefits: Supabase-compatible Auth API — all methods return { data, error }, supports phone, email, anonymous (disabled by default), username/password, OAuth, and third-party login methods
📌 Supabase API Compatibility: CloudBase Web SDK v3 auth module is designed with Supabase-like API ergonomics. If you are familiar with
supabase-jsauth patterns, the same mental model applies:
- All methods return
Promise<{ data, error }>— always checkerrorfirstsignInWithPassword,signInWithOtp,signUp,signOut,getSession,getUserfollow the same naming as SupabaseonAuthStateChange(callback)provides reactive auth state observation (events:INITIAL_SESSION,SIGNED_IN,SIGNED_OUT,TOKEN_REFRESHED,USER_UPDATED,PASSWORD_RECOVERY,BIND_IDENTITY)- Session management via
getSession()/refreshSession()/setSession()mirrors Supabase patternsKey differences from Supabase:
- OTP verification: Supabase uses a standalone
auth.verifyOtp({ phone, token, type })call; CloudBase returnsverifyOtpas a callback ondata— calldata.verifyOtp({ token })from thesignInWithOtp/signUpresultaccessKeyreplaces Supabase'sanonKey; environment usesenv+regioninstead of Supabase'surlsignInWithIdTokenfor direct third-party token login (similar to Supabase's same-named method)
Use npm installation for modern Web projects. In React, Vue, Vite, and other bundler-based apps, install and import @cloudbase/js-sdk from the project dependencies instead of using a CDN script.
Prerequisites
- Automatically use
auth-tool-cloudbaseto check app-side auth readiness viaqueryAppAuth/manageAppAuth, then get thepublishable keyand configure login methods. - If
auth-tool-cloudbasefailed, let user go tohttps://tcb.cloud.tencent.com/dev?envId={env}#/env/apikeyto getpublishable keyandhttps://tcb.cloud.tencent.com/dev?envId={env}#/identity/login-manageto set up login methods
Parameter map
- For username-style identifiers, the required precondition is
loginMethods.usernamePassword === truefromqueryAppAuth(action="getLoginConfig"). If it is false, enable it withmanageAppAuth(action="patchLoginStrategy", patch={ usernamePassword: true })before wiring frontend auth code. - If the conversation only provides an environment alias, nickname, or other shorthand, resolve it with
envQuery(action="list", alias=..., aliasExact=true)first and use the returned canonical fullEnvIdfor SDK init, console links, and generated config. Do not pass alias-like short forms directly intocloudbase.init({ env }). - Treat CloudBase Web Auth as Supabase-like, not “every
supabase-jsauth example is valid unchanged” - When
queryAppAuth/manageAppAuthreturnssdkStyle: "supabase-like"andsdkHints, follow those method and parameter hints first auth.signInWithOtp({ phone })andauth.signUp({ phone })use the phone number in aphonefield, notphone_numberauth.signInWithOtp({ email })andauth.signUp({ email })useemailauth.signInWithPassword({ username, password })is the canonical Web login path for username/password accounts- Treat direct Web
auth.signUp({ username, password })as conditional. VerifysdkHintsand the installed SDK first; some versions only supportsignUpfor OTP/provider-token flows and will not create username/password users. - If the task gives accounts like
admin,editor, or another plain string without@, treat it as a username-style identifier rather than an email address verifyOtp({ token })expects the SMS or email code intokenaccessKeyis the publishable key fromqueryAppAuth/manageAppAuthviaauth-tool-cloudbase, not a secret keyaccessKeytriggers automatic anonymous session creation — the deprecatedauth.getLoginState()returns an object with a validuideven without explicit login, which misleads route guards into thinking the user is authenticated. Useauth.getSession()instead — it returnsdata.session === undefinedwhen no real login has occurred, making auth checks straightforward and reliable.- Never set
accessKeytoenvId, a username, or any placeholder string. If you do not have a real Publishable Key yet, do not fabricate one. - If the task mentions provider setup, stop and read
auth-tool-cloudbasebefore writing frontend code
Quick Start
// npm install @cloudbase/js-sdk
import cloudbase from '@cloudbase/js-sdk'
const app = cloudbase.init({
env: 'your-full-env-id', // Canonical full CloudBase environment ID resolved from envQuery or the console, not an alias or shorthand
region: 'ap-shanghai', // CloudBase environment Region, default 'ap-shanghai'
accessKey: 'publishable key', // required, get from auth-tool-cloudbase
// ⚠️ With accessKey, the deprecated getLoginState() returns misleading auth data (uid)
// even without login. Always use auth.getSession() — returns undefined when not logged in.
auth: { detectSessionInUrl: true }, // required
})
const auth = app.auth
If the current task has not retrieved a real Publishable Key, omit accessKey instead of inventing one. A wrong accessKey can break auth-state checks and protected-route behavior.
Extended guide
For detailed scenarios, examples, and patterns, read extended-guide.md.
Reference index
All packaged reference files (required for skill lint reachability):
Alternatives
Compare before choosing
coreyhaines31/marketingskills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
alirezarezvani/claude-skills
app-store-optimization
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
migrate-vstest-to-mtp
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
JasonColapietro/suede-creator-skills
suede-ab-testing
Suede-owned experimentation discipline for hypotheses, sample sizing, test duration, significance, and repeatable experiment programs. Use when comparing variants, deciding whether a result is reliable, or building an experiment backlog and cadence. NOT FOR: analytics instrumentation (use suede-analytics), post-click conversion diagnosis (use suede-site-alchemy), or writing the variant copy itself (use suede-copy).