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.
Install / Use
npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill auth-web-cloudbaseInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of auth-web-cloudbase
auth-web-cloudbase scores 93/100 on our quality scale, 800th of 4,646 Development & Engineering skills we index (top 18%).
Its SKILL.md is 17 KB long, well organised into 16 sections with 10 code examples: a thorough specification that gives an agent plenty to work with.
With 1,124 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 9 days ago, so auth-web-cloudbase is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
auth-web-cloudbase compared with similar skills
All 4 of these similar skills score higher than auth-web-cloudbase; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| auth-web-cloudbase (this skill)by TencentCloudBase | 93 | 1.1k | 9d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install auth-web-cloudbase?
- Run
npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill auth-web-cloudbase. The install tabs above show the steps for each supported agent. - Which AI agents does auth-web-cloudbase work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is auth-web-cloudbase safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is auth-web-cloudbase still maintained?
- The repository was last updated 9 days ago, so auth-web-cloudbase is actively maintained.
Skill content
View source on GitHubname: auth-web-cloudbase description: 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. version: 2.34.8 alwaysApply: false
Sibling skills (local only)
Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.
If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.
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.mdfor provider setup../web-development/SKILL.mdfor 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()may still return an object with a validuideven without any login — causing route guards that check!!loginStateor!!uidto incorrectly pass. That misleadinguidis not a gateway-authenticated session. Useauth.getSession()instead: it returnsdata.session === undefinedwhen no real login has occurred. Only!!data.sessionfromgetSession()is a reliable authentication check. -
Assuming publishable
accessKeyalone is enough for NoSQL CRUD. NoSQLapp.database()get/add/update/watchrequires a gateway-authenticated session: use a real login (password / OTP / OAuth). Anonymous login is a demo-only escape hatch for explicitly-public, non-user data — it is disabled by default, denied AI model permissions, and must never stand in for real auth in user-scoped apps. Skipping any login yields gateway 401.checkLogin()/getSession()alone do not create a usable write session. -
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. -
Calling a standalone
auth.verifyOtp({ token })for OTP login. CloudBase Web SDK v3 returnsverifyOtpas a callback on thesignInWithOtp/signUpresult: send the code first, keep the returneddata, then calldata.verifyOtp({ token }). A standaloneauth.verifyOtp({ token })withoutmessageIdfails with"messageId is required"— seeing that error means the callback form was skipped. Seereferences/extended-guide.mdfor the full send → save callback → verify flow.Note: anonymous login is disabled by default for new environments and inactive existing environments. Do not enable it to work around permission errors — enable via
auth-tool-cloudbaseonly when the app explicitly serves public non-user data (e.g. NoSQL read-only demos). Always useauth.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. - Publishable key readiness (do not skip): call
queryAppAuth(action="getPublishableKey"). If it is empty, callmanageAppAuth(action="ensurePublishableKey")first — new environments may not have one provisioned, and skipping this step leaves the frontend without a data-plane credential, surfacing later as gateway auth failures instead of an obvious missing-key error. - Persist the key, don't hoard it in conversation: after retrieval, write the publishable key to
.env.localasVITE_PUBLISHABLE_KEY(create the file if missing) and read it in client code viaimport.meta.env.VITE_PUBLISHABLE_KEY. Never hardcode the key into source files, and never ask the user to fetch it from the console — fall back to the console link below only if both MCP calls fail. - 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
queryEnv(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 data.verifyOtp({ token })— theverifyOtpcallback on thesignInWithOtp/signUpresultdata— expects the SMS or email code intoken; do not invent a standaloneauth.verifyOtp({ token })call, which additionally requiresmessageIdaccessKeyis the publishable key fromqueryAppAuth/manageAppAuthviaauth-tool-cloudbase, not a secret keyaccessKeyalone does not create a gateway-authenticated session. PublishableaccessKeyinitializes the SDK; it does not replace a login for NoSQL CRUD. Anyapp.database()get/add/update/watchneeds a session — prefer a real login (password / OTP / OAuth);signInAnonymously()only for explicitly-public demo data (disabled by default, denied AI model permissions). Otherwise the gateway returns 401. Separately: the deprecatedauth.getLoginState()may still return a misleadinguidwithout login; useauth.getSession()for route guards (data.session === undefinedwhen not logged in).checkLogin()/getSession()alone do not create a usable write session.- 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
SDK init reference: docs.cloudbase.net/api-reference/webv3/initialization.md(URL 加 .md 可取 raw markdown 原文)
// 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 queryEnv 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
// ⚠️ accessKey alone ≠ a login session. NoSQL CRUD needs a session —
// real login preferred; signInAnony
Truncated for display — read the full file on GitHub.
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
