A comprehensive guide to implementing authentication and user identity within CloudBase projects.

Install

mkdir -p .claude/skills/cloudbase-auth && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4003" && unzip -o skill.zip -d .claude/skills/cloudbase-auth && rm skill.zip

Installs to .claude/skills/cloudbase-auth

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

A single skill that helps design and implement CloudBase Auth v2 using Web SDK, Node SDK, and HTTP APIs, including login methods, tokens, and best practices.
157 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Implements unified user login flows
  • Manages JWT and refresh token lifecycles
  • Handles account linking scenarios
  • Configures authentication state across SDKs
  • Provides login method integration

How it works

Maps authentication requirements to specific CloudBase Auth v2 SDK implementations and session management patterns.

Inputs & outputs

You give it
Auth method selection (e.g., email, OAuth)
You get back
Auth implementation code and token handling logic

When to use cloudbase-auth

  • Implement login methods for web apps
  • Manage JWT access tokens
  • Configure user identity systems

About this skill

When to use this skill

Use this skill whenever the task involves authentication or user identity in a CloudBase project, for example:

  • Designing which login methods to support (anonymous, username/password, SMS, email, WeChat, custom login)
  • Implementing auth with Web SDK (@cloudbase/[email protected]) on the frontend
  • Working with Node SDK for user info, admin operations, or issuing custom login tickets
  • Calling HTTP auth APIs directly from any backend or script
  • Understanding tokens, login state, and auth-related best practices

If the task is not about authentication (e.g. only about database or storage), this skill is probably not needed.

Quick orientation

CloudBase Auth v2 provides:

  • Multiple login methods with a unified user identity system
  • Clear user types (internal, external, anonymous) and account linking
  • A token-based session model with JWT access tokens and refresh tokens
  • SDKs (Web, Node) and HTTP APIs that expose the same core flows

This SKILL.md acts as a launcher. For deeper details, read the linked files only as needed.

Table of contents (progressive disclosure)

1. Concepts & design

  • concepts/overview.md – what CloudBase Auth v2 is, high-level architecture, and where to configure it.
  • concepts/login_methods.md – supported login methods, when to use each, and tradeoffs.
  • concepts/user_accounts_and_roles.md – internal vs external vs anonymous users, UIDs, and multi-account linking.
  • concepts/tokens_and_sessions.md – access_token vs refresh_token, v1 vs v2, and validation.

2. Web SDK (@cloudbase/[email protected])

  • web-sdk/web_quickstart.md – install/init SDK, get auth instance, basic sign-up/sign-in flow.
  • web-sdk/web_login_flows.md – concrete flows for:
    • Username/password
    • SMS verification code login
    • Email verification code login
    • Anonymous login and upgrade
    • WeChat OAuth login
  • web-sdk/captcha_and_rate_limits.md – when captchas are triggered, how to integrate the captcha adapter + UI, and how to handle errors.
  • web-sdk/web_best_practices.md – avoiding redundant logins, login-state persistence, and common UX patterns.

3. Node SDK & custom login

  • node-sdk/node_overview_and_user_info.md – using the Node SDK to get user info, end-user info, query users, and read client IP.
  • node-sdk/node_custom_login_ticket.md – issuing custom login tickets on the server and integrating with your own user system.

4. HTTP APIs

  • http-api/http_overview.md – the HTTP API surface for auth and how to discover endpoints.
  • http-api/http_login_and_token_flows.md – high-level flows for sign-in, sign-up, anonymous login, token grant/refresh/revoke, and user operations over HTTP.

5. Troubleshooting & FAQ

  • troubleshooting/faq.md – common questions and pitfalls: anonymous vs unauthenticated, token expiry, verification limits, etc.

How to use this skill

When working on a CloudBase auth task, follow this sequence:

  1. Clarify the scenario

    • Is this frontend Web, Node backend/cloud function, or a generic backend calling HTTP APIs?
    • What login methods are required (e.g. phone, email, WeChat, custom SSO, anonymous trial)?
    • Are there existing users/identity systems that must be integrated?
  2. Load only the relevant conceptual context

    • For high-level decisions, read:
      • concepts/overview.md
      • concepts/login_methods.md
      • concepts/user_accounts_and_roles.md
    • Read concepts/tokens_and_sessions.md only if token behavior or migration is important to the task.
  3. Jump to the relevant implementation section

    • For Web implementation details, read web-sdk/web_quickstart.md and then the specific flow file (e.g. web-sdk/web_login_flows.md, web-sdk/captcha_and_rate_limits.md).
    • For Node/server logic or custom login ticket issuance, use the node-sdk/ files.
    • For language-agnostic HTTP integration, use the http-api/ files.
  4. Design first, then code

    • Use the conceptual files to pick login methods, user types, and token strategy.
    • Then use Web/Node/HTTP sections to implement and verify the flow end-to-end.
  5. Use troubleshooting only when needed

    • Only read troubleshooting/faq.md when the user has issues like “anonymous vs not logged in”, unexpected expiration, or captcha errors.

Keep this file short in context. Load deeper files selectively based on the user’s question to keep the context window efficient.

When not to use it

  • Applications not using CloudBase Auth
  • Static websites with no user requirements

Prerequisites

@cloudbase/js-sdkCloudBase Auth v2 configured

Limitations

  • Coupled to CloudBase v2 ecosystem
  • Requires manual configuration of identity providers

How it compares

Provides a architecture for user identity rather than simple password checks.

Compared to similar skills

cloudbase-auth side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cloudbase-auth (this skill)18moNo flagsIntermediate
dependency-upgrade265moReviewIntermediate
turborepo612moReviewIntermediate
shopify-development126moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by TencentCloudBase

View all by TencentCloudBase

miniprogram-development

TencentCloudBase

WeChat Mini Program development rules. Use this skill when developing WeChat mini programs, integrating CloudBase capabilities, and deploying mini program projects.

3792

spec-workflow

TencentCloudBase

Standard software engineering workflow for requirement analysis, technical design, and task planning. Use this skill when developing new features, complex architecture designs, multi-module integrations, or projects involving database/UI design.

1091

ai-model-nodejs

TencentCloudBase

Use this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat).

59

web-development

TencentCloudBase

Web frontend project development rules. Use this skill when developing web frontend pages, deploying static hosting, and integrating CloudBase Web SDK.

514

ai-model-web

TencentCloudBase

Use this skill when developing browser/Web applications (React/Vue/Angular, static websites, SPAs) that need AI capabilities. Features text generation (generateText) and streaming (streamText) via @cloudbase/js-sdk. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). NOT for Node.js backend (use ai-model-nodejs), WeChat Mini Program (use ai-model-wechat), or image generation (Node SDK only).

13

auth-http-api-cloudbase

TencentCloudBase

Use when you need to implement CloudBase Auth v2 over raw HTTP endpoints (login/signup, tokens, user operations) from backends or scripts that are not using the Web or Node SDKs.

17

You might also like

dependency-upgrade

wshobson

Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.

26240

turborepo

vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

61191

shopify-development

davila7

Build Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid. TRIGGER: "shopify", "shopify app", "checkout extension", "admin extension", "POS extension", "shopify theme", "liquid template", "polaris", "shopify graphql", "shopify webhook", "shopify billing", "app subscription", "metafields", "shopify functions"

1299

markdown-to-html

github

Convert Markdown files to HTML similar to `marked.js`, `pandoc`, `gomarkdown/markdown`, or similar tools; or writing custom script to convert markdown to html and/or working on web template systems like `jekyll/jekyll`, `gohugoio/hugo`, or similar web templating systems that utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.

1662

upgrading-expo

sickn33

Upgrade Expo SDK versions

331

pnpm

antfu

Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.

421

Search skills

Search the agent skills registry