You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/source/skills/auth-tool/SKILL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,7 @@ Parameter mapping for downstream Web auth code:
135
135
-`UserNameLogin` also enables the broader password-login surface exposed by `auth.signInWithPassword({ username|email|phone, password })`
136
136
-`SmsVerificationConfig.Type = "apis"` requires both `Name` and `Method`
137
137
-`EnvId` is always the CloudBase environment ID, not the publishable key
138
+
- If the conversation only contains an environment alias, nickname, or other shorthand, resolve it to the canonical full `EnvId` first before generating auth config, SDK init examples, or console links
138
139
139
140
Internal behavior of `manageAppAuth(action="patchLoginStrategy")`:
Use the same CDN address as `web-development`. Prefer npm installation in modern bundler projects, and use the CDN form for static HTML, no-build demos, or low-friction examples.
63
+
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.
65
64
66
65
## Prerequisites
67
66
@@ -71,6 +70,7 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
71
70
### Parameter map
72
71
73
72
- For username-style identifiers, the required precondition is `loginMethods.usernamePassword === true` from `queryAppAuth(action="getLoginConfig")`. If it is false, enable it with `manageAppAuth(action="patchLoginStrategy", patch={ usernamePassword: true })` before wiring frontend auth code.
73
+
- If the conversation only provides an environment alias, nickname, or other shorthand, resolve it with `envQuery(action="list", alias=..., aliasExact=true)` first and use the returned canonical full `EnvId` for SDK init, console links, and generated config. Do not pass alias-like short forms directly into `cloudbase.init({ env })`.
74
74
- Treat CloudBase Web Auth as **Supabase-like**, not “every `supabase-js` auth example is valid unchanged”
75
75
- When `queryAppAuth` / `manageAppAuth` returns `sdkStyle: "supabase-like"` and `sdkHints`, follow those method and parameter hints first
76
76
-`auth.signInWithOtp({ phone })` and `auth.signUp({ phone })` use the phone number in a `phone` field, not `phone_number`
@@ -85,10 +85,11 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
85
85
## Quick Start
86
86
87
87
```js
88
+
// npm install @cloudbase/js-sdk
88
89
importcloudbasefrom'@cloudbase/js-sdk'
89
90
90
91
constapp=cloudbase.init({
91
-
env:`env`, // CloudBase environment ID
92
+
env:`env-xxxxx`, //Canonical full CloudBase environment ID, not an alias or shorthand
accessKey:'publishable key', // required, get from auth-tool-cloudbase
94
95
auth: { detectSessionInUrl:true }, // required
@@ -105,8 +106,9 @@ If the current task has not retrieved a real Publishable Key, omit `accessKey` i
105
106
106
107
**1. Phone OTP (Recommended)**
107
108
- Automatically use `auth-tool-cloudbase` to turn on `SMS Login` through `manageAppAuth`
109
+
- For phone registration, send the phone number to `auth.signUp({ phone, ... })` first, then call the returned `verifyOtp({ token })`. Do not swap the order.
Copy file name to clipboardExpand all lines: config/source/skills/web-development/SKILL.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,7 @@ Use this section only when the Web project needs CloudBase platform features.
117
117
- Use the CDN only for static HTML pages, quick demos, embedded snippets, or README examples
118
118
- Only use documented CloudBase Web SDK APIs; do not invent methods or options
119
119
- Keep a shared `app` or `auth` instance instead of re-initializing on every call
120
+
- If the user only provides an environment alias, nickname, or other shorthand, resolve it to the canonical full `EnvId` before writing SDK init code, console links, or config files. Do not pass alias-like short forms directly into `cloudbase.init({ env })`.
120
121
121
122
### Authentication boundary
122
123
@@ -134,10 +135,11 @@ Use this section only when the Web project needs CloudBase platform features.
134
135
### CloudBase quick start
135
136
136
137
```js
138
+
// npm install @cloudbase/js-sdk
137
139
importcloudbasefrom"@cloudbase/js-sdk";
138
140
139
141
constapp=cloudbase.init({
140
-
env:"xxxx-yyy",
142
+
env:"env-xxxxx", // Canonical full CloudBase environment ID
0 commit comments