auth-nodejs-cloudbase

Implements server-side CloudBase authentication and identity lookup in Node.js using the Node SDK.

Updated May 14, 2026
One-click install
npx skills add https://github.com/study-yang/Vieb-Coding-- --skill auth-nodejs-cloudbase-study-yang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-nodejs-cloudbase
Source: https://github.com/study-yang/Vieb-Coding--/tree/main/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%BF%AB%E8%AE%B0/.codebuddy/skills/auth-nodejs
Command: npx skills add https://github.com/study-yang/Vieb-Coding-- --skill auth-nodejs-cloudbase-study-yang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudbase/node-sdk.

What problem does it solve? Backend developers building CloudBase cloud functions or Node services often struggle to correctly read caller identity, look up end users, or bridge an existing user system into CloudBase without mixing up client-side and server-side auth responsibilities. ## Core Features & Use Cases - Caller Identity Reading: Use auth.getUserInfo() inside cloud functions to obtain uid, openId, and customUserId for authorization decisions. - User Lookup: Retrieve full end-user profiles by uid with getEndUserInfo or by phone, email, or custom ID with queryUserInfo. - Custom Login Tickets: Issue custom login tickets via createTicket so an existing user system can sign users into CloudBase without re-registration. - Use Case: A team with its own account database builds a Node backend that authenticates its users, issues CloudBase custom login tickets, and lets a web client sign in through @cloudbase/js-sdk. ## Quick Start Ask the AI to write a CloudBase cloud function in Node.js that reads the caller's identity and looks up a user profile using the CloudBase Node SDK.

Frequently Asked Questions about auth-nodejs-cloudbase

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

FAQPage Schema
How do I get the caller identity in a CloudBase cloud function?

Call auth.getUserInfo() from the @cloudbase/node-sdk inside your cloud function to retrieve openId, appId, uid, and customUserId. Use uid as the canonical identifier for authorization decisions rather than relying on openId alone.

How to look up a CloudBase user by phone number or email in Node.js?

Use auth.queryUserInfo with a platform and platformId, such as platform PHONE with a +86-prefixed number or platform EMAIL with the address. It returns the matching end-user profile and works for CUSTOM identifiers too.

What is a CloudBase custom login ticket and when should I use it?

A custom login ticket is created with auth.createTicket(customUserId, options) after your own backend authenticates a user. The client exchanges it via the Web SDK to sign into CloudBase, bridging your existing user system without re-registration.

Does the CloudBase Node SDK handle frontend login UI?

No, the Node SDK only covers server-side identity reading, user lookup, and ticket issuance. Frontend login and sign-up flows belong to @cloudbase/js-sdk on the web side, and provider configuration is done in the CloudBase console.

Why should tcb_custom_login.json never be bundled into frontend code?

The custom login credentials file acts as a private key that can mint login tickets for any customUserId. Exposing it in client code would let anyone forge identities, so it must stay on trusted backend infrastructure only.