auth-web-cloudbase

Integrate CloudBase web authentication with login, session, and user-management flows.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mrpersimmon/xiao-han-studio --skill auth-web-cloudbase-mrpersimmon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-web-cloudbase
Source: https://github.com/mrpersimmon/xiao-han-studio/tree/main/.agents/skills/cloudbase/references/auth-web
Command: npx skills add https://github.com/mrpersimmon/xiao-han-studio --skill auth-web-cloudbase-mrpersimmon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of wiring CloudBase authentication correctly into a web frontend, including login, registration, session handling, and user management, without breaking route guards or provider setup.

Core Features & Use Cases

  • Supabase-compatible Web Auth API: Use CloudBase @cloudbase/js-sdk auth methods with { data, error } patterns for predictable frontend integration.
  • Multiple login flows: Support phone OTP, email OTP, username/password, OAuth, ID-token login, and account upgrade from sessions.
  • Reliable authentication checks: Use auth.getSession() (not deprecated getLoginState()) to ensure protected routes only unlock after real login.
  • User management: Sign out, fetch user, update profile/email, change password, link/unlink identities, and delete account.

Use case example: You are building a React/Vue/Vite web app where users can sign up with a username and log in with password, then you need a protected dashboard route that must block anonymous users and correctly refresh session state.

Quick Start

Use the CloudBase JS SDK to initialize your app with the resolved full env and region, provide the accessKey from auth readiness, enable detectSessionInUrl, then implement login and protected-route checks using auth.getSession().

Frequently Asked Questions about auth-web-cloudbase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add CloudBase web authentication to my frontend app?

To add CloudBase web authentication, initialize the `@cloudbase/js-sdk` with your resolved `env` and `region`, provide the `accessKey`, and enable `detectSessionInUrl` for frontend login and session flows.

Why does my CloudBase protected route unlock for anonymous users?

Protected routes unlock for anonymous users if you use the deprecated `getLoginState()` method. You must use `auth.getSession()` instead to perform reliable authentication checks and block anonymous access.

Can I use phone OTP and OAuth login together in CloudBase web auth?

Yes, CloudBase web auth supports multiple login flows including phone OTP, email OTP, username/password, OAuth, and ID-token login simultaneously, provided you honor the enabled-login-method prerequisites.

What do I need to set up before implementing CloudBase web auth?

Before implementing CloudBase web auth, you need an auth-provider readiness validation via an app-side checklist, your resolved full `env` and `region`, and the publishable-key and enabled-login-method prerequisites.

Does the CloudBase JS SDK auth API return Supabase-like responses?

Yes, the CloudBase `@cloudbase/js-sdk` auth API uses Supabase-compatible `{ data, error }` response patterns to provide predictable frontend integration for login, registration, and user-management operations.

How do I manage user profiles and linked identities with CloudBase JS SDK?

You manage user profiles and identities by routing frontend operations through CloudBase Web auth methods to sign out, fetch users, update profiles, change passwords, link or unlink identities, and delete accounts.