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().