@buildbase/sdk 0.0.88 → 0.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/AGENTS.md +7 -3
  2. package/CHANGELOG.md +515 -0
  3. package/README.md +120 -3
  4. package/dist/cli.mjs +1 -1
  5. package/dist/css/styles.css +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +1351 -12
  8. package/dist/index.mjs +1 -1
  9. package/dist/mcp/index.cjs +1 -1
  10. package/dist/mcp/index.d.ts +120 -2
  11. package/dist/mcp/index.mjs +1 -1
  12. package/dist/react/chunks/SettingsDialog-BVyV5Zfm.mjs +2 -0
  13. package/dist/react/chunks/SettingsDialog-Ch8X6WXy.cjs +2 -0
  14. package/dist/react/chunks/{SubscriptionDialog-B8FTFRtp.cjs → SubscriptionDialog-CGIvMKpT.cjs} +1 -1
  15. package/dist/react/chunks/SubscriptionDialog-g0LwHhbe.mjs +2 -0
  16. package/dist/react/chunks/ar-3aqWucom.mjs +2 -0
  17. package/dist/react/chunks/ar-DQVB89r8.cjs +2 -0
  18. package/dist/react/chunks/de-DO10bhnU.cjs +2 -0
  19. package/dist/react/chunks/de-HXQk5D6k.mjs +2 -0
  20. package/dist/react/chunks/es-BZsmhBN3.mjs +2 -0
  21. package/dist/react/chunks/es-Cxg-qhUh.cjs +2 -0
  22. package/dist/react/chunks/fr-COCMy3vW.cjs +2 -0
  23. package/dist/react/chunks/fr-rdnNHzxy.mjs +2 -0
  24. package/dist/react/chunks/hi-BB0Z-Dgn.cjs +2 -0
  25. package/dist/react/chunks/hi-t3RH7ITu.mjs +2 -0
  26. package/dist/react/chunks/ja-CDyla2g0.mjs +2 -0
  27. package/dist/react/chunks/ja-D92JgUlk.cjs +2 -0
  28. package/dist/react/chunks/react-DTq7A_PT.mjs +2 -0
  29. package/dist/react/chunks/react-DeapSbq6.cjs +2 -0
  30. package/dist/react/chunks/zh-C5HABZZV.mjs +2 -0
  31. package/dist/react/chunks/zh-DK2yA5wB.cjs +2 -0
  32. package/dist/react/index.cjs +1 -1
  33. package/dist/react/index.d.ts +1517 -14
  34. package/dist/react/index.mjs +1 -1
  35. package/docs/ERROR_CODES.md +218 -0
  36. package/docs/THEMING.md +89 -21
  37. package/docs/UI-CONFIG.md +23 -4
  38. package/docs/USER-IMPORT.md +320 -0
  39. package/package.json +2 -1
  40. package/dist/react/chunks/SettingsDialog-CKVE1PpH.mjs +0 -2
  41. package/dist/react/chunks/SettingsDialog-DrDmxFEj.cjs +0 -2
  42. package/dist/react/chunks/SubscriptionDialog-UN7o9Hqb.mjs +0 -2
  43. package/dist/react/chunks/ar-B2l90OZJ.cjs +0 -2
  44. package/dist/react/chunks/ar-DVVNZhXD.mjs +0 -2
  45. package/dist/react/chunks/de-BspJtvAC.mjs +0 -2
  46. package/dist/react/chunks/de-dURUqbl0.cjs +0 -2
  47. package/dist/react/chunks/es-DArjREi5.cjs +0 -2
  48. package/dist/react/chunks/es-vu4BmI3g.mjs +0 -2
  49. package/dist/react/chunks/fr-DVm5WCvZ.mjs +0 -2
  50. package/dist/react/chunks/fr-DhYDaYrX.cjs +0 -2
  51. package/dist/react/chunks/hi-C_nv_c1T.cjs +0 -2
  52. package/dist/react/chunks/hi-VW8xCj_K.mjs +0 -2
  53. package/dist/react/chunks/ja-C-b88dvw.mjs +0 -2
  54. package/dist/react/chunks/ja-CqtDkLHr.cjs +0 -2
  55. package/dist/react/chunks/react-CHivaJhA.mjs +0 -2
  56. package/dist/react/chunks/react-Ch_Suxxy.cjs +0 -2
  57. package/dist/react/chunks/zh-D1yfhUf0.mjs +0 -2
  58. package/dist/react/chunks/zh-D_tMpsNt.cjs +0 -2
@@ -37,7 +37,463 @@ interface IUser extends IDocument {
37
37
  /** Currency code. May be omitted. */
38
38
  currency?: string;
39
39
  attributes?: Record<string, string | number | boolean>;
40
+ /**
41
+ * The user has a confirmed authenticator app, so sign-in asks for a second
42
+ * step. Read-only: it changes through the two-step sign-in calls on
43
+ * `WorkspaceApi`, never through `updateUserProfile`. Absent from a server
44
+ * that predates two-step sign-in.
45
+ */
46
+ mfaEnabled?: boolean;
47
+ /**
48
+ * The user can change their email address with `requestEmailChange` and
49
+ * `confirmEmailChange`. Read-only, from the profile. Absent from a server
50
+ * that predates changing email, which reads as `false`.
51
+ */
52
+ canChangeEmail?: boolean;
53
+ /**
54
+ * Why `canChangeEmail` is false, when the user should be told. Absent when
55
+ * the change is allowed or no reason is given.
56
+ */
57
+ changeEmailBlockedBy?: ChangeEmailBlockedBy;
58
+ /**
59
+ * The user's id in the system they were imported from (`buildbase import`),
60
+ * so an app can map its own rows to this account. Read-only, from the
61
+ * profile. Absent for anyone who was not imported.
62
+ */
63
+ externalId?: string;
64
+ /**
65
+ * The user's phone number, as E.164 (`+14155550123`). Read-only: it changes
66
+ * through `addPhone`, `confirmPhone` and `removePhone` on `WorkspaceApi`,
67
+ * never through `updateUserProfile`. Absent until the user adds one, signs
68
+ * up by phone or is imported with one, and from a server that predates
69
+ * phone numbers.
70
+ */
71
+ phone?: string;
72
+ /** The phone was proven with a code sent to it. Read-only, from the profile. */
73
+ phoneVerified?: boolean;
74
+ /**
75
+ * The user's username, lower case, while the app has usernames on: `''`
76
+ * when they have none. Changes through `setUsername` and `removeUsername` on
77
+ * `WorkspaceApi`. Absent from a server that predates usernames.
78
+ */
79
+ username?: string;
80
+ /**
81
+ * Custom claims the app owner set for this user, from the console or with
82
+ * an API token; `{}` when there are none. Read-only to the user, who cannot
83
+ * change them. The same object reaches the app's backend as `claims` on the
84
+ * app-token request (`AppTokenRequestClaims.claims`).
85
+ */
86
+ claims?: Record<string, unknown>;
87
+ /**
88
+ * A guest: someone who continued without an account. Their name is `Guest`
89
+ * and their email a placeholder ending in `@anonymous.invalid` that must
90
+ * never be shown. They become a real account, keeping their id and data,
91
+ * with `requestGuestUpgrade` and `confirmGuestUpgrade`.
92
+ */
93
+ isAnonymous?: boolean;
94
+ /**
95
+ * When the account deletion the user asked for runs (ISO 8601). Absent
96
+ * unless one is scheduled; `cancelAccountDeletion` takes it back until then.
97
+ */
98
+ deleteAfter?: string;
99
+ /**
100
+ * When this session last proved who its person is (ISO 8601): the sign-in,
101
+ * or the latest re-confirmation. `null` for a session nobody signed in to
102
+ * (an API-key exchange), which never counts as recent.
103
+ */
104
+ authTime?: string | null;
105
+ /** How this session proved it (`amr`, RFC 8176), such as `['pwd', 'mfa']`. */
106
+ amr?: string[];
107
+ /**
108
+ * Present while an app owner is viewing the app as this person: who, until
109
+ * when, and whether the session can change anything.
110
+ */
111
+ impersonation?: IImpersonation;
112
+ /**
113
+ * The person has a password they know, so `changePassword` can work. False
114
+ * for an account made by social sign-up, a wallet, or a code or link sent
115
+ * by email or text, which holds a random password nobody knows: they set
116
+ * one with Forgot password? on the sign-in page. Absent from a server that
117
+ * predates it.
118
+ */
119
+ passwordSet?: boolean;
120
+ /**
121
+ * The app this session signed in to offers password sign-in. Absent when
122
+ * the session names no app, and from a server that predates it.
123
+ */
124
+ passwordSignIn?: boolean;
125
+ }
126
+ /**
127
+ * The `code` on an error from `changePassword`: the server's `reason`, passed
128
+ * through unchanged.
129
+ *
130
+ * `password_not_set` (409): the account has no password the person knows,
131
+ * so there is none to change; the attempt does not count toward the sign-in
132
+ * lockout. `invalid` (400): the current password is wrong (it counts toward
133
+ * the lockout) or the new one was found in a data breach. `locked` (429):
134
+ * too many wrong passwords, so wait up to 15 minutes, or reset the password,
135
+ * which lifts it.
136
+ */
137
+ type PasswordChangeErrorCode = 'password_not_set' | 'invalid' | 'locked';
138
+ /**
139
+ * An app owner signed in as this person from the console, to see what they
140
+ * see. Every change in a read-only session is refused with
141
+ * `read_only_session`, and in any such session a change to how the person
142
+ * signs in is refused with `impersonation_sign_in_locked`.
143
+ */
144
+ interface IImpersonation {
145
+ /** The owner's name, as the console has it. */
146
+ actorName: string;
147
+ /** The session can only read. The default; full access needs the owner role. */
148
+ readOnly: boolean;
149
+ /** When the session ends (ISO 8601), at most an hour after it began. */
150
+ expiresAt: string;
40
151
  }
152
+ /**
153
+ * What a re-confirmation can be asked to include beyond signing in: `mfa`,
154
+ * the user's second step, for someone who has one.
155
+ */
156
+ type ReverifyFactor = 'mfa';
157
+ /** Where to send the browser to confirm it is still the same person. */
158
+ interface IReverificationStart {
159
+ /** The hosted sign-in page, bound to this session. */
160
+ url: string;
161
+ }
162
+ /**
163
+ * The `code` on an error from `startReverification`.
164
+ *
165
+ * `reverify_unavailable` (400): this session cannot be re-confirmed, because
166
+ * nobody signed in to it (an API-key exchange), an owner is viewing as the
167
+ * user, or the user is a guest. `invalid_return_url` (400): the return URL is
168
+ * not one of the auth client's redirect URLs.
169
+ */
170
+ type ReverifyErrorCode = 'reverify_unavailable' | 'invalid_return_url';
171
+ /**
172
+ * Refusals any session-authenticated route may answer, beside its own.
173
+ *
174
+ * `reauth_required` (403): the change needs a recent sign-in. The error
175
+ * carries `maxAgeSeconds` (how recent) and, when the change also needs the
176
+ * user's second step, `factors`. Re-confirm with `requireReverification`;
177
+ * it is never a reason to sign out. `read_only_session` (403): an app owner
178
+ * is viewing as the user, read-only, so nothing can change.
179
+ * `impersonation_sign_in_locked` (403): an app owner is signed in as the
180
+ * user, read-only or not, and the call would change how the user signs in
181
+ * (email, phone, username, password, second step, passkeys, linked accounts,
182
+ * guest upgrade), which stays the user's. Show the server's sentence.
183
+ */
184
+ type SessionRefusalCode = 'reauth_required' | 'read_only_session' | 'impersonation_sign_in_locked';
185
+ /** A deletion the user asked for. */
186
+ interface IAccountDeletion {
187
+ /**
188
+ * When the account is deleted (ISO 8601), unless cancelled first. `null`
189
+ * when the app deletes at once: the account is already gone.
190
+ */
191
+ deleteAfter: string | null;
192
+ /** The account was deleted now, and this session ended with it. */
193
+ deleted: boolean;
194
+ }
195
+ /** A workspace that keeps the user from deleting their account, as the refusal names it. */
196
+ interface IOwnedWorkspace {
197
+ id: string;
198
+ name: string;
199
+ }
200
+ /**
201
+ * The `code` on an error from `requestAccountDeletion`: the server's
202
+ * `reason`, passed through unchanged.
203
+ *
204
+ * `owns_workspaces` (409) carries `workspaces` (`IOwnedWorkspace[]`): the
205
+ * workspaces the user created that have other members or a subscription.
206
+ * Nothing hands a workspace to someone else, so the way through is to remove
207
+ * the other members and cancel the subscription, or delete the workspace.
208
+ */
209
+ type AccountDeletionErrorCode = 'reauth_required' | 'owns_workspaces' | 'read_only_session';
210
+ /** Whether the app has usernames on, from its public auth config. */
211
+ interface IUsernamePolicy {
212
+ /** Users can have a username and sign in with it. */
213
+ enabled: boolean;
214
+ /** Every user must have one: it can be changed, never removed. */
215
+ required: boolean;
216
+ }
217
+ /**
218
+ * The `code` on an error from `setUsername` and `removeUsername`.
219
+ *
220
+ * `invalid_username` (400), `username_taken` (409), `usernames_off` (400:
221
+ * the app has usernames off), `username_required` (409, on removing: the app
222
+ * requires one).
223
+ */
224
+ type UsernameErrorCode = 'invalid_username' | 'username_taken' | 'usernames_off' | 'username_required';
225
+ /** What a guest gives to become a real account. */
226
+ interface IGuestUpgradeRequest {
227
+ /** The address the account will have, proven by a code sent to it. */
228
+ email: string;
229
+ /** Their name, in place of `Guest`. */
230
+ name?: string;
231
+ /** A password to sign in with, at least 8 characters. */
232
+ password?: string;
233
+ }
234
+ /** A code went to the address; the guest is still a guest. */
235
+ interface IGuestUpgradeStarted {
236
+ /** Seconds before another code can be sent. */
237
+ retryAfter: number;
238
+ }
239
+ /**
240
+ * The `code` on an error from `requestGuestUpgrade` and
241
+ * `confirmGuestUpgrade`: the server's `reason`, passed through unchanged.
242
+ */
243
+ type GuestUpgradeErrorCode = 'email_unavailable' | 'not_a_guest' | 'signup_restricted' | 'waitlist_required' | 'signup_closed' | 'disposable_email' | 'breached_password' | 'cooldown' | 'recipient_limit' | 'not_sent' | 'invalid_code' | 'code_expired';
244
+ /** A chain a wallet signs in on. */
245
+ type WalletChain = 'ethereum' | 'solana';
246
+ /** The wallets the app takes, on `getConnectedAccounts().wallet`. */
247
+ interface IWalletOptions {
248
+ /** EIP-155 chain ids an Ethereum wallet may sign on. Empty: no Ethereum wallets. */
249
+ ethereumChainIds: number[];
250
+ /** Solana wallets are taken. */
251
+ solana: boolean;
252
+ }
253
+ /** What goes into the message a wallet signs to connect to the account. */
254
+ interface IWalletNonce {
255
+ /** Spent by the first message that names it; lapses after 5 minutes. */
256
+ nonce: string;
257
+ /** The host the message names on its first line. */
258
+ domain: string;
259
+ /** The page the message names as `URI`. */
260
+ uri: string;
261
+ /** When the nonce was issued (ISO 8601), the message's `Issued At`. */
262
+ issuedAt: string;
263
+ /** Ethereum only: the chain ids the app takes. */
264
+ chainIds?: number[];
265
+ }
266
+ /** A signed message that connects a wallet. */
267
+ interface IWalletLinkRequest {
268
+ chain: WalletChain;
269
+ /** The EIP-4361 message (or its Solana sibling), exactly as signed. */
270
+ message: string;
271
+ /** Hex (`0x`, 65 bytes) for Ethereum, base58 (64 bytes) for Solana. */
272
+ signature: string;
273
+ }
274
+ /**
275
+ * The `code` on an error from `requestWalletNonce` and `linkWallet`.
276
+ *
277
+ * `nonce_expired` is a 401 that does not end the session: the message was
278
+ * not signed in time, so start again.
279
+ */
280
+ type WalletErrorCode = 'method_unavailable' | 'chain_not_allowed' | 'invalid_message' | 'invalid_signature' | 'nonce_expired' | 'link_conflict' | 'guest_account';
281
+ /**
282
+ * A social sign-in linked to the signed-in user: one row of
283
+ * `getConnectedAccounts().accounts`.
284
+ */
285
+ interface IConnectedAccount {
286
+ /** The link's id, for `unlinkAccount`. */
287
+ _id: string;
288
+ /**
289
+ * The provider's catalog id: `google`, `linkedIn`, `github`, `microsoft` or
290
+ * `apple`, `custom:<methodId>` for an app's own OIDC provider, or
291
+ * `ethereum` or `solana` for a wallet.
292
+ */
293
+ provider: string;
294
+ /** What to call it, from the catalog (a custom provider's own label). */
295
+ label: string;
296
+ /** An absolute URL to the provider's icon on the BuildBase server. */
297
+ icon?: string;
298
+ /** Which one it is, when the label alone does not say: a wallet's short address. */
299
+ detail?: string;
300
+ /** When it was linked. */
301
+ createdAt?: string;
302
+ /**
303
+ * False when removing it would leave the user no way to sign in: the
304
+ * server refuses with `last_sign_in_method`, so the screen says so first.
305
+ */
306
+ canUnlink: boolean;
307
+ }
308
+ /** A social sign-in the app offers that the user has not linked yet. */
309
+ interface IAvailableAccountProvider {
310
+ /** The provider's catalog id, as on `IConnectedAccount.provider`. */
311
+ provider: string;
312
+ label: string;
313
+ icon?: string;
314
+ /** The sign-in method to pass to `linkAccount`. */
315
+ methodId: string;
316
+ }
317
+ /** The signed-in user's connected accounts, and what else they can connect. */
318
+ interface IConnectedAccounts {
319
+ /** The user's live social links and wallets. */
320
+ accounts: IConnectedAccount[];
321
+ /** The social methods on this app the user has not linked. */
322
+ available: IAvailableAccountProvider[];
323
+ /**
324
+ * The wallets the app takes, while it offers wallet sign-in: connect one
325
+ * with `requestWalletNonce` and `linkWallet`. Absent otherwise.
326
+ */
327
+ wallet?: IWalletOptions;
328
+ /**
329
+ * How many ways the user can sign in: live links, passkeys, a password they
330
+ * set themselves while the app offers password sign-in, and a verified email
331
+ * while it offers magic links or email codes.
332
+ */
333
+ signInWays: number;
334
+ /**
335
+ * This session proved who its person is in the last 10 minutes. Removing a
336
+ * connected account needs that; otherwise the server answers
337
+ * `reauth_required`.
338
+ */
339
+ recentSignIn: boolean;
340
+ }
341
+ /** Where to send the browser to link a provider. */
342
+ interface IAccountLinkStart {
343
+ url: string;
344
+ }
345
+ /**
346
+ * The `code` on an error from `getConnectedAccounts`, `linkAccount` and
347
+ * `unlinkAccount`: the server's `reason`, passed through unchanged.
348
+ *
349
+ * `reauth_required` (403) is a refusal, not a dead session: the SDK does not
350
+ * sign the user out for it. Only a 401 does.
351
+ */
352
+ type ConnectedAccountErrorCode = 'reauth_required' | 'last_sign_in_method' | 'already_linked' | 'method_unavailable';
353
+ /**
354
+ * Why linking failed, as the server says on the way back from the provider:
355
+ * the `reason` query parameter beside `error`.
356
+ *
357
+ * The provider: `provider_error` (cancelled or refused there),
358
+ * `provider_failed` (its answer could not be used), `no_verified_email` (the
359
+ * provider account has no verified address, as GitHub's can). The link:
360
+ * `link_conflict` (that provider account belongs to another user here),
361
+ * `session_ended`. A guest connecting a provider becomes that account, so
362
+ * its address is checked as a sign-up's: `email_unverified`,
363
+ * `email_unavailable`, `disposable_email`, `signup_closed`,
364
+ * `signup_restricted`, `waitlist_required`, and `not_a_guest` when the guest
365
+ * became an account in another tab meanwhile.
366
+ */
367
+ type AccountLinkErrorReason = 'link_conflict' | 'provider_error' | 'provider_failed' | 'session_ended' | 'no_verified_email' | 'email_unverified' | 'email_unavailable' | 'disposable_email' | 'signup_closed' | 'signup_restricted' | 'waitlist_required' | 'not_a_guest';
368
+ /**
369
+ * Why the signed-in user cannot change their email address.
370
+ *
371
+ * `linked_social_account`: the account signs in with Google or another
372
+ * provider, which finds the account by its email address, so changing it would
373
+ * create a second account at the next such sign-in. Only an older server says
374
+ * so: social sign-in now finds the account by the provider's own ID, and a
375
+ * current server always answers `canChangeEmail: true`.
376
+ */
377
+ type ChangeEmailBlockedBy = 'linked_social_account';
378
+ /** A code went to the new address; the email has not changed yet. */
379
+ interface IEmailChangeRequest {
380
+ /** Seconds before another code can be sent. */
381
+ retryAfter: number;
382
+ }
383
+ /** The email change went through. */
384
+ interface IEmailChangeResult {
385
+ /** The address the account has now, verified. */
386
+ email: string;
387
+ }
388
+ /**
389
+ * The `code` on an error from `requestEmailChange` and `confirmEmailChange`:
390
+ * the server's `reason`, passed through unchanged.
391
+ */
392
+ type EmailChangeErrorCode = 'email_unavailable' | 'linked_social_account' | 'guest_account' | 'cooldown' | 'disposable_email' | 'invalid_code' | 'code_expired';
393
+ /** Who has to use two-step sign-in in an app, as its organization set it. */
394
+ type MfaEnforcement = 'off' | 'optional' | 'required';
395
+ /**
396
+ * A second-step method the app allows: an authenticator app (`totp`), or a
397
+ * code sent by text message to the user's verified phone (`sms`). An app never
398
+ * allows `sms` alone.
399
+ */
400
+ type MfaFactorType = 'totp' | 'sms';
401
+ /** The signed-in user's two-step sign-in, and what the app allows. */
402
+ interface IMfaStatus {
403
+ /** An authenticator app is set up and confirmed. */
404
+ enabled: boolean;
405
+ /**
406
+ * `optional` lets each user choose, `required` asks everyone. `off` asks
407
+ * nobody for a second step and nothing new can be set up, but what a user
408
+ * set up before can still be removed.
409
+ */
410
+ enforcement: MfaEnforcement;
411
+ allowedFactors: MfaFactorType[];
412
+ /** When the authenticator app was confirmed. Only while `enabled`. */
413
+ confirmedAt?: string;
414
+ /** When a code from it, or a backup code, last passed. Only while `enabled`. */
415
+ lastUsedAt?: string;
416
+ /** Unused backup codes. Only while `enabled`. */
417
+ backupCodesRemaining?: number;
418
+ /** Text messages as a second step. Absent from a server that predates them. */
419
+ sms?: IMfaSmsStatus;
420
+ }
421
+ /**
422
+ * Text messages as a second step, for the signed-in user. Weaker than an
423
+ * authenticator app: a phone number can be moved to someone else's SIM card.
424
+ */
425
+ interface IMfaSmsStatus {
426
+ /**
427
+ * The user may turn it on: the app's factors include `sms`, an SMS provider
428
+ * is connected, and the app's plan serves phone codes.
429
+ */
430
+ allowed: boolean;
431
+ /** The user has it on. */
432
+ enrolled: boolean;
433
+ /** The number codes go to, masked (`+1 ••• ••• 0123`). Only while `enrolled`. */
434
+ phone?: string;
435
+ }
436
+ /** How a phone code is delivered. A call that names none gets a text message. */
437
+ type PhoneChannel = 'sms' | 'whatsapp' | 'voice';
438
+ /** A code went to a phone; nothing has changed yet. */
439
+ interface IPhoneCodeSent {
440
+ /** Seconds before another code can be sent. */
441
+ retryAfter: number;
442
+ /**
443
+ * The number the code went to, as the server shows it (masked for the
444
+ * second step). Only when the server says.
445
+ */
446
+ phone?: string;
447
+ }
448
+ /** The code was right: the number is the account's, verified. */
449
+ interface IPhoneConfirmed {
450
+ /** The number, as E.164. */
451
+ phone: string;
452
+ phoneVerified: true;
453
+ }
454
+ /** Text messages are on as a second step. */
455
+ interface ISmsEnrollmentResult {
456
+ /**
457
+ * Backup codes, when the server issued them with this factor. Shown once,
458
+ * like the authenticator app's.
459
+ */
460
+ backupCodes?: string[];
461
+ }
462
+ /**
463
+ * The `code` on an error from the phone calls (`addPhone`, `confirmPhone`,
464
+ * `removePhone`) and the text-message factor (`startSmsEnrollment`,
465
+ * `confirmSmsEnrollment`, `disableSms`): the server's `reason`, passed through
466
+ * unchanged.
467
+ *
468
+ * `reauth_required` (403) and `code_expired` (410) are refusals, not a dead
469
+ * session: the SDK does not sign the user out for them. Only a 401 does.
470
+ * `method_unavailable` (400, from `addPhone`): the app does not send codes
471
+ * the way asked for, such as by text message.
472
+ */
473
+ type PhoneErrorCode = 'invalid_phone' | 'method_unavailable' | 'phone_unavailable' | 'cooldown' | 'rate_limited' | 'number_refused' | 'sms_unavailable' | 'invalid_code' | 'code_expired' | 'reauth_required' | 'last_sign_in_method' | 'mfa_sms_enrolled' | 'phone_required' | 'factor_not_allowed';
474
+ /**
475
+ * A started authenticator-app setup. Pending until `confirmTotpEnrollment`
476
+ * accepts a first code; starting again replaces it.
477
+ */
478
+ interface ITotpEnrollment {
479
+ /** Base32 secret, for typing into an app that cannot scan. */
480
+ secret: string;
481
+ /** The `otpauth://` URL the QR code encodes. */
482
+ otpauthUrl: string;
483
+ /** The QR code as an SVG document, rendered by the server. Show it as an image, never as markup. */
484
+ qrSvg: string;
485
+ }
486
+ /** Single-use backup codes. The server returns them once and keeps only hashes. */
487
+ interface IMfaBackupCodes {
488
+ backupCodes: string[];
489
+ }
490
+ /**
491
+ * The `code` on an error from the two-step sign-in calls: the server's
492
+ * `reason`, passed through unchanged.
493
+ */
494
+ type MfaErrorCode = 'mfa-off' | 'already-enrolled' | 'not-enrolling' | 'not-enrolled' | 'invalid-code' | 'required-by-org' | 'locked'
495
+ /** A guest, who creates an account before setting up a second step (409). */
496
+ | 'guest_account';
41
497
  /** A registered passkey (WebAuthn credential) — no key material exposed. */
42
498
  interface IPasskeySummary {
43
499
  id: string;
@@ -1061,6 +1517,10 @@ interface AuthUser {
1061
1517
  id: string;
1062
1518
  name: string;
1063
1519
  org: string;
1520
+ /**
1521
+ * The user's email address. Empty for a guest (`isAnonymous`), whose
1522
+ * placeholder address is never shown or passed on.
1523
+ */
1064
1524
  email: string;
1065
1525
  emailVerified: boolean;
1066
1526
  clientId: string;
@@ -1075,15 +1535,90 @@ interface AuthUser {
1075
1535
  * person twice when they sign up on one device and open the app on another.
1076
1536
  */
1077
1537
  firstAuthAt?: string;
1538
+ /**
1539
+ * The user has a second step: a confirmed authenticator app, or text
1540
+ * message codes. From the profile at sign-in; the Security screen keeps it
1541
+ * current when the user turns either on or off there. `false` when the
1542
+ * server predates two-step sign-in.
1543
+ */
1544
+ mfaEnabled: boolean;
1545
+ /**
1546
+ * The user can change their email address, which the Profile screen offers.
1547
+ * From the profile at sign-in. `false` when the server predates changing
1548
+ * email.
1549
+ */
1550
+ canChangeEmail: boolean;
1551
+ /** Why `canChangeEmail` is false, when the user should be told. */
1552
+ changeEmailBlockedBy?: ChangeEmailBlockedBy;
1553
+ /**
1554
+ * The user's id in the system they were imported from (`buildbase import`),
1555
+ * from the profile at sign-in. Absent for anyone who was not imported.
1556
+ */
1557
+ externalId?: string;
1558
+ /**
1559
+ * The user's phone number, as E.164 (`+14155550123`), from the profile at
1560
+ * sign-in. The Security screen keeps it current when the user adds, verifies
1561
+ * or removes it there. Absent when the user has none, and from a server that
1562
+ * predates phone numbers.
1563
+ */
1564
+ phone?: string;
1565
+ /** The phone was proven with a code sent to it. Present only with `phone`. */
1566
+ phoneVerified?: boolean;
1567
+ /**
1568
+ * The user's username, lower case, while the app has usernames on and they
1569
+ * set one. The Profile screen keeps it current. Absent otherwise.
1570
+ */
1571
+ username?: string;
1572
+ /**
1573
+ * Custom claims the app owner set for this user, from the profile at
1574
+ * sign-in: `{}` when there are none, and from a server that predates them.
1575
+ * Read-only to the user.
1576
+ */
1577
+ claims: Record<string, unknown>;
1578
+ /**
1579
+ * A guest, who continued without an account: their `email` is empty, and
1580
+ * they become a real account with `useGuestUpgrade`. `false` for everyone
1581
+ * else.
1582
+ */
1583
+ isAnonymous: boolean;
1584
+ /**
1585
+ * When the account deletion the user asked for runs (ISO 8601), while one
1586
+ * is scheduled. The Security screen keeps it current, and the settings
1587
+ * dialog shows it at the top of every screen, with Cancel deletion.
1588
+ */
1589
+ deleteAfter?: string;
1078
1590
  }
1079
1591
  interface AuthSession {
1080
1592
  user: AuthUser;
1081
1593
  sessionId: string;
1082
1594
  expires: string;
1595
+ /**
1596
+ * When this session last proved who its person is (ISO 8601): the sign-in,
1597
+ * or the latest re-confirmation (`requireReverification`). Absent when it
1598
+ * never has (an API-key exchange), and from a server that predates it.
1599
+ */
1600
+ authTime?: string;
1601
+ /** How it proved it (`amr`, RFC 8176), such as `['pwd', 'mfa']`. */
1602
+ amr?: string[];
1603
+ /**
1604
+ * Present while an app owner is viewing the app as this person. A
1605
+ * read-only one refuses every change with `read_only_session`, and any one
1606
+ * refuses a change to how the person signs in with
1607
+ * `impersonation_sign_in_locked`; the SDK shows a banner for as long as it
1608
+ * lasts.
1609
+ */
1610
+ impersonation?: IImpersonation;
1083
1611
  }
1084
1612
  interface IAuthConfig {
1085
1613
  clientId: string;
1086
1614
  redirectUrl: string;
1615
+ /**
1616
+ * The language the hosted sign-in page opens in, one of the SDK's eight
1617
+ * (`SUPPORTED_LOCALES`; a regional tag such as `es-MX` is narrowed to
1618
+ * `es`). Defaults to the provider's `locale` when that is set; with
1619
+ * neither, the page goes by the person's own choice and their browser.
1620
+ */
1621
+ locale?: string;
1087
1622
  callbacks?: IAuthCallbacks;
1088
1623
  }
1089
1624
  interface IAuthCallbacks {
@@ -1276,6 +1811,16 @@ interface IBaseApiConfig {
1276
1811
  /** Custom fetch implementation. */
1277
1812
  fetch?: typeof globalThis.fetch;
1278
1813
  }
1814
+ /** Per-request options that are not part of fetch's own `RequestInit`. */
1815
+ interface IRequestOptions {
1816
+ /**
1817
+ * Leave a 401 to the caller instead of calling `onUnauthorized`, which ends
1818
+ * the session. For a route that answers 401 for a refusal of its own (an
1819
+ * expired code) while the session is fine: the caller reads the body and
1820
+ * calls `notifyUnauthorized()` for any 401 that is not that refusal.
1821
+ */
1822
+ deferUnauthorized?: boolean;
1823
+ }
1279
1824
  /**
1280
1825
  * Base class for SDK API clients.
1281
1826
  * Provides:
@@ -1318,6 +1863,12 @@ declare abstract class BaseApi {
1318
1863
  private reportError;
1319
1864
  /** Execute fetch with timeout, retries, debug logging, and error callback. */
1320
1865
  private executeFetch;
1866
+ /**
1867
+ * Tell the app the session is dead (`onUnauthorized`). Only for a caller
1868
+ * that set `deferUnauthorized` and found a 401 that is not its route's own
1869
+ * refusal; every other 401 already does this.
1870
+ */
1871
+ protected notifyUnauthorized(): void;
1321
1872
  /** Backoff sleep that ends early (with an AbortError) when the signal fires. */
1322
1873
  private static delay;
1323
1874
  /** Internal: execute fetch against a resolved URL with timeout, retries, debug logging, and error callback. */
@@ -1331,7 +1882,7 @@ declare abstract class BaseApi {
1331
1882
  * Execute request and return raw Response (for custom parsing or error handling).
1332
1883
  * Caller is responsible for checking response.ok and parsing body.
1333
1884
  */
1334
- protected fetchResponse(path: string, init?: RequestInit): Promise<Response>;
1885
+ protected fetchResponse(path: string, init?: RequestInit, options?: IRequestOptions): Promise<Response>;
1335
1886
  /**
1336
1887
  * Execute request, throw a parsed error on !response.ok, and unwrap the
1337
1888
  * `{ success, data }` envelope. Shorthand for the common
@@ -1454,6 +2005,13 @@ interface AuthRequestParams {
1454
2005
  * Populated automatically from the parked invitation when there is one.
1455
2006
  */
1456
2007
  invitationToken?: string;
2008
+ /**
2009
+ * The language the hosted sign-in page opens in: one of the SDK's eight
2010
+ * (`SUPPORTED_LOCALES`). Without it the page goes by the person's own
2011
+ * choice, then their browser, then the app's default. `signIn` sends the
2012
+ * app's `auth.locale`, else the provider's `locale`, when either is set.
2013
+ */
2014
+ locale?: string;
1457
2015
  }
1458
2016
  /**
1459
2017
  * Unwrapped payload of a successful auth request.
@@ -1477,6 +2035,20 @@ declare class AuthApi extends BaseApi {
1477
2035
  * envelopes with `success: false` both throw a structured Error.
1478
2036
  */
1479
2037
  requestAuth(params: AuthRequestParams): Promise<AuthRequestResponse>;
2038
+ /**
2039
+ * Whether the app has usernames on, from its public auth config
2040
+ * (`GET /api/v1/auth/config?org=`). Both false when it has them off, and
2041
+ * from a server that predates usernames.
2042
+ */
2043
+ getUsernamePolicy(orgId: string, signal?: AbortSignal): Promise<IUsernamePolicy>;
2044
+ /**
2045
+ * Days between a person asking to delete their account and the account
2046
+ * going, from the app's public auth config (`security.accountDeletionGraceDays`).
2047
+ * 0 means at once. Read by the server's own rule: anything that is not a
2048
+ * number, which includes a server that predates account deletion, is the
2049
+ * default of 7, and the rest is held to 0 to 30.
2050
+ */
2051
+ getAccountDeletionGraceDays(orgId: string, signal?: AbortSignal): Promise<number>;
1480
2052
  /** Fetch user profile with the given session ID (used after OAuth redirect or from storage). */
1481
2053
  getProfile(sessionId: string, signal?: AbortSignal): Promise<IUser>;
1482
2054
  /**
@@ -2109,9 +2681,286 @@ declare class WorkspaceApi extends BaseApi {
2109
2681
  getWorkspace(workspaceId: string, signal?: AbortSignal): Promise<IWorkspace>;
2110
2682
  getProfile(signal?: AbortSignal): Promise<IUser>;
2111
2683
  updateUserProfile(config: Partial<IUser>, signal?: AbortSignal): Promise<IUser>;
2684
+ /**
2685
+ * Change the signed-in user's password.
2686
+ *
2687
+ * A wrong `currentPassword` counts toward the account's sign-in lockout (10
2688
+ * failures in 15 minutes), after which the server answers 429 (`locked`)
2689
+ * until the window passes or the password is reset. A wrong one, or a new
2690
+ * one found in a known data breach, is 400 (`invalid`). On success every
2691
+ * other session for the user ends and this one stays.
2692
+ *
2693
+ * An account made by social sign-up, a wallet, or a code or link has no
2694
+ * password the person knows (the profile's `passwordSet` is false). The
2695
+ * server refuses it with 409 `password_not_set`, without counting toward
2696
+ * the lockout; the person sets one with Forgot password? on the sign-in
2697
+ * page. The error carries the server's sentence and `code`
2698
+ * (`PasswordChangeErrorCode`).
2699
+ */
2700
+ changePassword(currentPassword: string, newPassword: string, signal?: AbortSignal): Promise<void>;
2701
+ /**
2702
+ * Run a call whose refusals are `{ success: false, message, reason?,
2703
+ * retryAfter? }`: two-step sign-in, changing email, connected accounts,
2704
+ * the phone, re-confirming, deleting the account, the username, a guest's
2705
+ * upgrade, wallets and passkeys. The error keeps the server's sentence as its message
2706
+ * and carries `status`, the reason as `code` (an `MfaErrorCode`, an
2707
+ * `EmailChangeErrorCode`, a `ConnectedAccountErrorCode`, a
2708
+ * `PhoneErrorCode`, a `SessionRefusalCode` and the rest), on a cooldown
2709
+ * `retryAfter` in seconds, on `reauth_required` `maxAgeSeconds` and the
2710
+ * `factors` it asks for, and on `owns_workspaces` the `workspaces`, so a
2711
+ * screen can act on the refusal without parsing the sentence.
2712
+ *
2713
+ * `reasons401` lists the reasons this route answers with a 401 while the
2714
+ * session is fine (an expired code). A 401 carrying one of them is only a
2715
+ * refusal; any other 401 still ends the session, as it does everywhere.
2716
+ */
2717
+ private fetchWithReason;
2718
+ /** A code as typed or pasted: authenticator apps often show `123 456`. */
2719
+ private static compactCode;
2720
+ /**
2721
+ * Send a 6-digit code to `newEmail`. Nothing changes until
2722
+ * `confirmEmailChange` accepts the code. Resolves with `retryAfter`, the
2723
+ * seconds before another code can be sent.
2724
+ *
2725
+ * Refused with `email_unavailable` (409) for an address this app cannot
2726
+ * use, whether it is taken or invalid, `cooldown` (429, carrying
2727
+ * `retryAfter`) inside the resend window, `disposable_email` (400) when the
2728
+ * app blocks disposable addresses, and `guest_account` (409) for a guest,
2729
+ * who creates an account instead.
2730
+ */
2731
+ requestEmailChange(newEmail: string, signal?: AbortSignal): Promise<IEmailChangeRequest>;
2732
+ /**
2733
+ * Change the email to the address the code went to. Spaces in the code are
2734
+ * dropped. Resolves with the new address, which is verified; the old one is
2735
+ * mailed a notice, and every session stays signed in.
2736
+ *
2737
+ * Refused with `invalid_code` (400), and `code_expired` (410) when no code is
2738
+ * pending, it lapsed, or it used its tries, so the user asks for a new one.
2739
+ * A 401 that names `code_expired` (from a server before the status moved to
2740
+ * 410) is read the same way and does not sign the user out; any other 401
2741
+ * on this route still means the session is over.
2742
+ */
2743
+ confirmEmailChange(code: string, signal?: AbortSignal): Promise<IEmailChangeResult>;
2744
+ /**
2745
+ * Send a code to `phone` (E.164), the number the user wants on their
2746
+ * account. Nothing changes until `confirmPhone` accepts the code. Resolves
2747
+ * with `retryAfter`, the seconds before another code can be sent. `channel`
2748
+ * asks for WhatsApp or a voice call where the app offers them; without it
2749
+ * the code is a text message.
2750
+ *
2751
+ * Refused with `invalid_phone` (400), `method_unavailable` (400) when the
2752
+ * app does not send codes that way, `phone_unavailable` (409) for a number
2753
+ * on another account, `cooldown` (429, carrying `retryAfter`) and
2754
+ * `rate_limited` (429), `number_refused` (422) when the provider will not
2755
+ * send to it, and `sms_unavailable` (503) when codes cannot be sent.
2756
+ */
2757
+ addPhone(phone: string, channel?: PhoneChannel, signal?: AbortSignal): Promise<IPhoneCodeSent>;
2758
+ /**
2759
+ * Make the number the code went to the account's, verified. Spaces in the
2760
+ * code are dropped. Resolves with the number.
2761
+ *
2762
+ * Refused with `invalid_code` (400), and `code_expired` (410) when no code
2763
+ * is pending, it lapsed or it used its tries, so the user asks for a new one.
2764
+ */
2765
+ confirmPhone(code: string, signal?: AbortSignal): Promise<IPhoneConfirmed>;
2766
+ /**
2767
+ * Take the phone number off the account.
2768
+ *
2769
+ * Refused with `reauth_required` (403) when this session started more than
2770
+ * 10 minutes ago, so the user signs in again first; this does not sign them
2771
+ * out. `last_sign_in_method` (409) when it is the only way they can sign in,
2772
+ * and `mfa_sms_enrolled` (409) while text-message codes for two-step sign-in
2773
+ * go to it.
2774
+ */
2775
+ removePhone(signal?: AbortSignal): Promise<void>;
2776
+ /** The signed-in user's two-step sign-in, and what the app allows. */
2777
+ getMfaStatus(signal?: AbortSignal): Promise<IMfaStatus>;
2778
+ /**
2779
+ * Start adding an authenticator app: a fresh secret, its `otpauth://` URL
2780
+ * and a QR code the server rendered as SVG. Nothing is on until
2781
+ * `confirmTotpEnrollment` accepts a first code, and starting again replaces
2782
+ * a pending setup.
2783
+ *
2784
+ * Refused with `mfa-off` (403) when the app has two-step sign-in turned off,
2785
+ * and `already-enrolled` (409) when an authenticator app is already set up.
2786
+ */
2787
+ startTotpEnrollment(signal?: AbortSignal): Promise<ITotpEnrollment>;
2788
+ /**
2789
+ * Confirm the pending authenticator app with the 6-digit code it shows,
2790
+ * which turns two-step sign-in on. Spaces in the code are dropped. Resolves
2791
+ * with the backup codes, which the server returns this once and never again.
2792
+ *
2793
+ * Refused with `invalid-code` (400), and `not-enrolling` (409) when no setup
2794
+ * is pending, so the user starts again.
2795
+ */
2796
+ confirmTotpEnrollment(code: string, signal?: AbortSignal): Promise<IMfaBackupCodes>;
2797
+ /**
2798
+ * Turn two-step sign-in off by removing the authenticator app. Needs a
2799
+ * current 6-digit code or an unused backup code; a wrong one counts toward
2800
+ * the account's lockout. Every device that remembered the second step
2801
+ * forgets it.
2802
+ *
2803
+ * Refused with `required-by-org` (403) while the app requires two-step
2804
+ * sign-in, `invalid-code` (400), `not-enrolled` (404), and `locked` (429)
2805
+ * after too many wrong codes.
2806
+ */
2807
+ disableTotp(code: string, signal?: AbortSignal): Promise<void>;
2808
+ /**
2809
+ * Replace the backup codes. Needs a current code or an unused backup code,
2810
+ * with the same refusals as `disableTotp` apart from `required-by-org`. The
2811
+ * old codes stop working; the new ones are returned this once.
2812
+ */
2813
+ regenerateBackupCodes(code: string, signal?: AbortSignal): Promise<IMfaBackupCodes>;
2814
+ /**
2815
+ * Send a code to the account's verified phone to turn text-message codes
2816
+ * on. Resolves with `retryAfter`, and the masked number when the server
2817
+ * says which.
2818
+ *
2819
+ * Refused with `phone_required` (409) when the account has no verified
2820
+ * phone, so the user adds one first; `factor_not_allowed` (403) when the app
2821
+ * does not allow it; and the sending refusals of `addPhone` (`cooldown`,
2822
+ * `rate_limited`, `number_refused`, `sms_unavailable`).
2823
+ */
2824
+ startSmsEnrollment(signal?: AbortSignal): Promise<IPhoneCodeSent>;
2825
+ /**
2826
+ * Turn text-message codes on with the code `startSmsEnrollment` sent. Spaces
2827
+ * in the code are dropped. Resolves with backup codes when the server issued
2828
+ * them, which it returns this once.
2829
+ *
2830
+ * Refused with `invalid_code` (400) and `code_expired` (410).
2831
+ */
2832
+ confirmSmsEnrollment(code: string, signal?: AbortSignal): Promise<ISmsEnrollmentResult>;
2833
+ /**
2834
+ * Turn text-message codes off.
2835
+ *
2836
+ * Refused with `reauth_required` (403) when this session started more than
2837
+ * 10 minutes ago, so the user signs in again first; this does not sign them
2838
+ * out.
2839
+ */
2840
+ disableSms(signal?: AbortSignal): Promise<void>;
2112
2841
  getPasskeys(signal?: AbortSignal): Promise<IPasskeySummary[]>;
2113
2842
  renamePasskey(passkeyId: string, name: string, signal?: AbortSignal): Promise<void>;
2114
2843
  deletePasskey(passkeyId: string, signal?: AbortSignal): Promise<void>;
2844
+ /**
2845
+ * The user's linked social sign-ins (`accounts`), the ones the app offers
2846
+ * that they have not linked (`available`), how many ways they can sign in,
2847
+ * and whether this session is recent enough to remove one.
2848
+ */
2849
+ getConnectedAccounts(signal?: AbortSignal): Promise<IConnectedAccounts>;
2850
+ /**
2851
+ * Start linking a provider: resolves with the `url` to send the browser to.
2852
+ * The person signs in there and comes back to `redirect`, which must be on
2853
+ * an origin the app registered for sign-in, with `?linked=<provider>` on
2854
+ * success, or `?error=...&reason=...` (an `AccountLinkErrorReason`) when it
2855
+ * failed.
2856
+ *
2857
+ * Refused with `method_unavailable` (404) when `methodId` is not a social
2858
+ * sign-in on this app, `already_linked` (409) when the user already has
2859
+ * that provider, and 400 for a missing or unregistered `redirect`. A POST,
2860
+ * so it is never retried.
2861
+ */
2862
+ linkAccount(methodId: string, redirect: string, signal?: AbortSignal): Promise<IAccountLinkStart>;
2863
+ /**
2864
+ * Remove one linked sign-in, by its `_id` from `getConnectedAccounts`.
2865
+ *
2866
+ * Refused with `reauth_required` (403) when this session started more than
2867
+ * 10 minutes ago, so the user signs in again first; this does not sign
2868
+ * them out. `last_sign_in_method` (409) when it is the only way they can
2869
+ * sign in (`canUnlink` is false), and 404 when the link is not theirs.
2870
+ */
2871
+ unlinkAccount(accountId: string, signal?: AbortSignal): Promise<void>;
2872
+ /**
2873
+ * A nonce for the message that connects a wallet on `chain`, with the
2874
+ * domain, URI and time the message must carry (`buildWalletMessage` lays it
2875
+ * out). The wallet signs it and `linkWallet` sends it, within 5 minutes.
2876
+ *
2877
+ * Refused with `method_unavailable` (403) when the app offers no wallet
2878
+ * sign-in, and `chain_not_allowed` (400) for a kind of wallet it does not
2879
+ * take.
2880
+ */
2881
+ requestWalletNonce(chain: WalletChain, signal?: AbortSignal): Promise<IWalletNonce>;
2882
+ /**
2883
+ * Connect the wallet that signed `message` (exactly as signed) with
2884
+ * `signature`: hex for Ethereum, base58 for Solana. Resolves with its row
2885
+ * in the connected accounts, the short address as `detail`; read the list
2886
+ * again for whether it can be removed.
2887
+ *
2888
+ * Refused with `link_conflict` (409) when the wallet is on another account,
2889
+ * `invalid_signature` (400), `invalid_message` (400) for a message this page
2890
+ * did not make, `chain_not_allowed` (400), `guest_account` (409) for a guest,
2891
+ * who creates an account first, and `nonce_expired` (401) when the nonce
2892
+ * lapsed or was spent. That 401 is a refusal, not a dead session: it does
2893
+ * not sign the user out, and connecting starts again.
2894
+ */
2895
+ linkWallet(input: IWalletLinkRequest, signal?: AbortSignal): Promise<IConnectedAccount>;
2896
+ /**
2897
+ * Start re-confirming who the user is. Resolves with the hosted sign-in
2898
+ * page to send the browser to; signing in there as the same person brings
2899
+ * it back to `returnUrl` with `?reverified=1`. `factors: ['mfa']` asks for
2900
+ * the second step too, for someone who has one. `returnUrl` must be one of
2901
+ * the auth client's redirect URLs. `requireReverification` on
2902
+ * `useSaaSAuth()` does all of this, coming back to the page it was on.
2903
+ *
2904
+ * Refused with `reverify_unavailable` (400) for a session nobody signed in
2905
+ * to, one an owner holds as the user, or a guest's, and
2906
+ * `invalid_return_url` (400).
2907
+ */
2908
+ startReverification(options: {
2909
+ returnUrl: string;
2910
+ factors?: ReverifyFactor[];
2911
+ }, signal?: AbortSignal): Promise<IReverificationStart>;
2912
+ /**
2913
+ * Ask for the account to be deleted. After the app's grace period it is,
2914
+ * with its personal data; until then `cancelAccountDeletion` takes it back,
2915
+ * and the profile carries `deleteAfter`. Every other session ends now and
2916
+ * this one stays. An app with no grace period deletes at once: `deleted` is
2917
+ * true and this session has ended too.
2918
+ *
2919
+ * Refused with `reauth_required` (403, carrying `maxAgeSeconds`) unless the
2920
+ * user signed in recently, and `owns_workspaces` (409, carrying
2921
+ * `workspaces`) while they created a workspace that has other members or a
2922
+ * subscription. A POST, never retried.
2923
+ */
2924
+ requestAccountDeletion(signal?: AbortSignal): Promise<IAccountDeletion>;
2925
+ /**
2926
+ * Take back a scheduled deletion. `cancelled` is false when none was
2927
+ * scheduled, which is not a refusal.
2928
+ */
2929
+ cancelAccountDeletion(signal?: AbortSignal): Promise<{
2930
+ cancelled: boolean;
2931
+ }>;
2932
+ /**
2933
+ * Set or change the username, while the app has usernames on. The server
2934
+ * stores it lower case; `isValidUsername` checks the same rules first.
2935
+ *
2936
+ * Refused with `invalid_username` (400), `username_taken` (409) and
2937
+ * `usernames_off` (400).
2938
+ */
2939
+ setUsername(username: string, signal?: AbortSignal): Promise<{
2940
+ username: string;
2941
+ }>;
2942
+ /** Remove the username. Refused with `username_required` (409) while the app requires one. */
2943
+ removeUsername(signal?: AbortSignal): Promise<void>;
2944
+ /**
2945
+ * Check the address (and the password, when one is given) and mail a code
2946
+ * to it. Nothing changes until `confirmGuestUpgrade` accepts the code.
2947
+ * Resolves with `retryAfter`, the seconds before another code can be sent.
2948
+ *
2949
+ * Refused with `email_unavailable` (409), `not_a_guest` (409),
2950
+ * `signup_restricted`, `waitlist_required` or `signup_closed` (403),
2951
+ * `disposable_email` and `breached_password` (400), and `cooldown` (429,
2952
+ * carrying `retryAfter`). A POST, never retried.
2953
+ */
2954
+ requestGuestUpgrade(input: IGuestUpgradeRequest, signal?: AbortSignal): Promise<IGuestUpgradeStarted>;
2955
+ /**
2956
+ * Become a real account with the code `requestGuestUpgrade` mailed. Spaces
2957
+ * in the code are dropped. Resolves with the profile: the same user id, the
2958
+ * address verified, `isAnonymous` false.
2959
+ *
2960
+ * Refused with `invalid_code` (400), and `code_expired` (410) when no code
2961
+ * is pending, it lapsed or it used its tries.
2962
+ */
2963
+ confirmGuestUpgrade(code: string, signal?: AbortSignal): Promise<IUser>;
2115
2964
  /**
2116
2965
  * Get current subscription for a workspace
2117
2966
  * Returns subscription details including plan, plan version, and group information
@@ -2550,6 +3399,7 @@ declare const BBScreen: {
2550
3399
  readonly Usage: "usage";
2551
3400
  readonly Users: "users";
2552
3401
  readonly Profile: "profile";
3402
+ readonly Security: "security";
2553
3403
  readonly General: "general";
2554
3404
  readonly Features: "features";
2555
3405
  readonly Notifications: "notifications";
@@ -3106,6 +3956,10 @@ interface SDKMessages {
3106
3956
  connectedAgentsGranted: string;
3107
3957
  connectedAgentsLoadFailed: string;
3108
3958
  connectedAgentsRevokeFailed: string;
3959
+ connectedAgentsConfirmTitle: string;
3960
+ connectedAgentsConfirmBody: string;
3961
+ connectedAgentsCancel: string;
3962
+ connectedAgentsDisconnected: string;
3109
3963
  mcpConnectAction: string;
3110
3964
  mcpGuideTitle: string;
3111
3965
  mcpGuideDescription: string;
@@ -3135,6 +3989,147 @@ interface SDKMessages {
3135
3989
  renamePlaceholder: string;
3136
3990
  lastUsed: string;
3137
3991
  added: string;
3992
+ passwordTitle: string;
3993
+ passwordDescription: string;
3994
+ currentPassword: string;
3995
+ newPassword: string;
3996
+ passwordRequired: string;
3997
+ passwordMinLength: string;
3998
+ changePassword: string;
3999
+ passwordChanged: string;
4000
+ passwordSocialHint: string;
4001
+ passwordNone: string;
4002
+ passwordNoneHint: string;
4003
+ twoStepTitle: string;
4004
+ twoStepDescription: string;
4005
+ twoStepSetUp: string;
4006
+ twoStepRequiredSetup: string;
4007
+ twoStepScan: string;
4008
+ twoStepQrAlt: string;
4009
+ twoStepManualKey: string;
4010
+ twoStepCodeLabel: string;
4011
+ twoStepCodeInvalid: string;
4012
+ twoStepTurnOn: string;
4013
+ twoStepEnabled: string;
4014
+ twoStepBackupTitle: string;
4015
+ twoStepBackupDescription: string;
4016
+ twoStepCopy: string;
4017
+ twoStepCopied: string;
4018
+ twoStepDone: string;
4019
+ twoStepAppName: string;
4020
+ twoStepBackupLeft: string;
4021
+ twoStepNewCodes: string;
4022
+ twoStepTurnOff: string;
4023
+ twoStepRequiredNote: string;
4024
+ twoStepCurrentCodeLabel: string;
4025
+ twoStepCurrentCodeRequired: string;
4026
+ twoStepTurnOffHint: string;
4027
+ twoStepNewCodesHint: string;
4028
+ twoStepDisabled: string;
4029
+ twoStepCodesRegenerated: string;
4030
+ twoStepOffDescription: string;
4031
+ twoStepRemoveHint: string;
4032
+ twoStepRemoved: string;
4033
+ connectedAccountsTitle: string;
4034
+ connectedAccountsDescription: string;
4035
+ connectedAccountsEmpty: string;
4036
+ connectedAccountsAvailable: string;
4037
+ connectedAccountsConnect: string;
4038
+ connectedAccountsLastWay: string;
4039
+ connectedAccountsRemoveTitle: string;
4040
+ connectedAccountsRemoveDescription: string;
4041
+ connectedAccountsRemoved: string;
4042
+ connectedAccountsLinked: string;
4043
+ connectedAccountsLinkedGeneric: string;
4044
+ connectedAccountsReauth: string;
4045
+ connectedAccountsSignInAgain: string;
4046
+ connectedAccountsLinkConflict: string;
4047
+ connectedAccountsProviderError: string;
4048
+ connectedAccountsProviderFailed: string;
4049
+ connectedAccountsSessionEnded: string;
4050
+ connectedAccountsNoVerifiedEmail: string;
4051
+ connectedAccountsEmailUnverified: string;
4052
+ connectedAccountsEmailUnavailable: string;
4053
+ connectedAccountsDisposableEmail: string;
4054
+ connectedAccountsSignupClosed: string;
4055
+ connectedAccountsSignupRestricted: string;
4056
+ connectedAccountsWaitlistRequired: string;
4057
+ connectedAccountsNotAGuest: string;
4058
+ twoStepGuest: string;
4059
+ phoneTitle: string;
4060
+ phoneDescription: string;
4061
+ phoneEmpty: string;
4062
+ phoneAdd: string;
4063
+ phoneChange: string;
4064
+ phoneCountryLabel: string;
4065
+ phoneNumberHint: string;
4066
+ phoneNumberInvalid: string;
4067
+ phoneSendCode: string;
4068
+ phoneSentTo: string;
4069
+ phoneCodeLabel: string;
4070
+ phoneCodeInvalid: string;
4071
+ phoneResend: string;
4072
+ phoneResendIn: string;
4073
+ phoneWait: string;
4074
+ phoneResent: string;
4075
+ phoneVerify: string;
4076
+ phoneVerified: string;
4077
+ phoneNotVerified: string;
4078
+ phoneSaved: string;
4079
+ phoneRemoveTitle: string;
4080
+ phoneRemoveDescription: string;
4081
+ phoneRemoved: string;
4082
+ phoneReauth: string;
4083
+ phoneLastWay: string;
4084
+ phoneUsedForTwoStep: string;
4085
+ phoneSmsUnavailable: string;
4086
+ phoneCheckUnavailable: string;
4087
+ phoneTextUnavailable: string;
4088
+ twoStepSmsName: string;
4089
+ twoStepSmsWeaker: string;
4090
+ twoStepSmsTo: string;
4091
+ twoStepSmsNeedsPhone: string;
4092
+ twoStepSmsGoToPhone: string;
4093
+ twoStepSmsSentGeneric: string;
4094
+ twoStepSmsEnabled: string;
4095
+ twoStepSmsDisabled: string;
4096
+ twoStepSmsTurnOffTitle: string;
4097
+ twoStepSmsTurnOffDescription: string;
4098
+ twoStepSmsReauth: string;
4099
+ reauthConfirm: string;
4100
+ reauthConfirmed: string;
4101
+ /** Confirm it's you, pressed while an app owner is signed in as the person. */
4102
+ reauthImpersonating: string;
4103
+ deleteAccountTitle: string;
4104
+ deleteAccountDescription: string;
4105
+ deleteAccountWarning: string;
4106
+ deleteAccountWarningNow: string;
4107
+ deleteAccountWarningDays: string;
4108
+ deleteAccountTypeLabel: string;
4109
+ deleteAccountWord: string;
4110
+ deleteAccountConfirm: string;
4111
+ deleteAccountScheduled: string;
4112
+ /** The notice at the top of every settings screen while a deletion is scheduled. */
4113
+ deleteAccountNotice: string;
4114
+ deleteAccountCancel: string;
4115
+ deleteAccountCancelled: string;
4116
+ deleteAccountReauth: string;
4117
+ deleteAccountOwnsWorkspaces: string;
4118
+ impersonationReadOnly: string;
4119
+ impersonationFull: string;
4120
+ /** Under the full-access line: sign-in changes stay locked in such a session. */
4121
+ impersonationSignInLocked: string;
4122
+ impersonationExit: string;
4123
+ impersonationRegion: string;
4124
+ walletConnectEthereum: string;
4125
+ walletConnectSolana: string;
4126
+ walletNotFound: string;
4127
+ walletRejected: string;
4128
+ walletBusy: string;
4129
+ walletWrongNetwork: string;
4130
+ walletNoAccount: string;
4131
+ walletFailed: string;
4132
+ walletHint: string;
3138
4133
  devicesTitle: string;
3139
4134
  devicesDescription: string;
3140
4135
  devicesEmpty: string;
@@ -3542,6 +4537,31 @@ interface SDKMessages {
3542
4537
  nameMinLength: string;
3543
4538
  save: string;
3544
4539
  reset: string;
4540
+ changeEmail: string;
4541
+ changeEmailNewLabel: string;
4542
+ changeEmailNewHint: string;
4543
+ changeEmailInvalid: string;
4544
+ changeEmailSame: string;
4545
+ changeEmailSend: string;
4546
+ changeEmailSentTo: string;
4547
+ changeEmailCodeLabel: string;
4548
+ changeEmailCodeInvalid: string;
4549
+ changeEmailConfirm: string;
4550
+ changeEmailResend: string;
4551
+ changeEmailResendIn: string;
4552
+ changeEmailResent: string;
4553
+ changeEmailChanged: string;
4554
+ changeEmailBlockedSocial: string;
4555
+ username: string;
4556
+ usernameHint: string;
4557
+ usernameInvalid: string;
4558
+ usernameSave: string;
4559
+ usernameRemove: string;
4560
+ usernameSaved: string;
4561
+ usernameRemoved: string;
4562
+ usernameRequiredNote: string;
4563
+ /** The profile could not be read; the screen offers Retry. */
4564
+ loadFailed: string;
3545
4565
  };
3546
4566
  general: {
3547
4567
  ownerOnly: string;
@@ -3838,6 +4858,25 @@ interface SDKMessages {
3838
4858
  insufficientCredits: string;
3839
4859
  insufficientDetail: string;
3840
4860
  };
4861
+ guest: {
4862
+ title: string;
4863
+ description: string;
4864
+ emailLabel: string;
4865
+ nameLabel: string;
4866
+ passwordLabel: string;
4867
+ passwordHint: string;
4868
+ emailInvalid: string;
4869
+ passwordMinLength: string;
4870
+ send: string;
4871
+ sentTo: string;
4872
+ codeLabel: string;
4873
+ codeInvalid: string;
4874
+ resend: string;
4875
+ resendIn: string;
4876
+ resent: string;
4877
+ confirm: string;
4878
+ done: string;
4879
+ };
3841
4880
  loading: {
3842
4881
  restoringSession: string;
3843
4882
  redirecting: string;
@@ -3847,6 +4886,8 @@ interface SDKMessages {
3847
4886
  };
3848
4887
  errors: {
3849
4888
  networkError: string;
4889
+ /** No answer from the server: offline, or a proxy or gateway failed. */
4890
+ unreachable: string;
3850
4891
  unauthorized: string;
3851
4892
  notFound: string;
3852
4893
  generic: string;
@@ -3874,6 +4915,60 @@ interface SDKMessages {
3874
4915
  fetchExpiringCredits: string;
3875
4916
  fetchWorkspaces: string;
3876
4917
  };
4918
+ /**
4919
+ * Plain-language help the settings screens open from a "?" button
4920
+ * (`FieldHelp`): what a thing is, what it does, and what happens next.
4921
+ */
4922
+ help: {
4923
+ /** The "?" button's name, `{label}` the thing it explains. */
4924
+ button: string;
4925
+ /** A help link's name, `{link}` its words. */
4926
+ linkNewTab: string;
4927
+ twoStep: string;
4928
+ twoStepApp: string;
4929
+ twoStepSms: string;
4930
+ twoStepLostPhone: string;
4931
+ /** Shown under the setup key: it is a secret. */
4932
+ twoStepKeyPrivate: string;
4933
+ backupCodesLabel: string;
4934
+ backupCodes: string;
4935
+ backupCodesKeep: string;
4936
+ backupCodesNew: string;
4937
+ passkeys: string;
4938
+ passkeysWhere: string;
4939
+ passkeysRemove: string;
4940
+ /** `{label}`: the "This device" badge. */
4941
+ devicesThis: string;
4942
+ /** `{label}`: the "Trusted" badge. */
4943
+ devicesTrusted: string;
4944
+ /** `{label}`: the device's Sign out button. */
4945
+ devicesSignOut: string;
4946
+ /** `{label}`: the device's Remove button. */
4947
+ devicesRemove: string;
4948
+ sessionsWhat: string;
4949
+ /** `{label}`: the "This one" badge. */
4950
+ sessionsThis: string;
4951
+ /** `{label}`: the session's Sign out button. */
4952
+ sessionsSignOut: string;
4953
+ sessionsEverywhere: string;
4954
+ connectedAccounts: string;
4955
+ connectedAccountsRemove: string;
4956
+ connectedAccountsLastWay: string;
4957
+ phone: string;
4958
+ phoneCheck: string;
4959
+ reauth: string;
4960
+ reauthHow: string;
4961
+ email: string;
4962
+ emailChange: string;
4963
+ password: string;
4964
+ passwordLeaks: string;
4965
+ passwordForgot: string;
4966
+ /** `{days}`: the app's grace period; `{cancel}`: the Cancel deletion button. */
4967
+ deleteAccountDays: string;
4968
+ deleteAccountNow: string;
4969
+ /** `{cancel}`: the Cancel deletion button. */
4970
+ deleteAccountRange: string;
4971
+ };
3877
4972
  }
3878
4973
  /** Supported locale codes */
3879
4974
  type SDKLocale = 'en' | 'es' | 'fr' | 'de' | 'ja' | 'zh' | 'hi' | 'ar';
@@ -3882,7 +4977,7 @@ type DeepPartialMessages<T> = {
3882
4977
  [K in keyof T]?: T[K] extends string ? string : DeepPartialMessages<T[K]>;
3883
4978
  };
3884
4979
  /**
3885
- * Per-key overrides for SDK UI strings — any subset of the SDKMessages tree.
4980
+ * Per-key overrides for SDK UI strings: any subset of the SDKMessages tree.
3886
4981
  * Deep-merged over the active locale bundle by the translation provider.
3887
4982
  */
3888
4983
  type PartialSDKMessages = DeepPartialMessages<SDKMessages>;
@@ -3914,6 +5009,216 @@ type Level4 = {
3914
5009
  /** Union of all valid translation key paths (e.g. "settings.titles.profile") */
3915
5010
  type TranslationKey = Level2 | Level3 | Level4;
3916
5011
 
5012
+ /**
5013
+ * Re-confirm before sensitive actions,
5014
+ * kept apart from React so every step is testable without a DOM.
5015
+ *
5016
+ * A change that needs a recent sign-in answers 403 `reauth_required`. The
5017
+ * person confirms it is still them on the hosted sign-in page, which brings
5018
+ * the browser back with `?reverified=1` and the same session, now recent: no
5019
+ * new session and no code to exchange.
5020
+ *
5021
+ * The server takes a return URL only when it is one of the auth client's
5022
+ * redirect URLs, matched exactly (or by a wildcard the owner registered). The
5023
+ * page a person is on rarely is, so this asks for the page first and, when
5024
+ * the server refuses it with `invalid_return_url`, comes back through the
5025
+ * app's registered `auth.redirectUrl` instead, with the page parked as the
5026
+ * auth intent: the provider continues to it after the hop, as it does after
5027
+ * signing in.
5028
+ */
5029
+
5030
+ /** What `requireReverification` takes. */
5031
+ interface RequireReverificationOptions {
5032
+ /**
5033
+ * Where to come back to afterwards. Defaults to the page the person is on.
5034
+ * It must be on this app's origin.
5035
+ */
5036
+ returnUrl?: string;
5037
+ /** Ask for the second step too (`['mfa']`), for someone who has one. */
5038
+ factors?: ReverifyFactor[];
5039
+ /**
5040
+ * Go ahead without leaving the page when this session proved who its
5041
+ * person is within this many seconds (and with `factors`, when asked).
5042
+ * Without it the person is always sent to confirm.
5043
+ */
5044
+ maxAgeSeconds?: number;
5045
+ }
5046
+ /**
5047
+ * `recent`: the session is recent enough, so go ahead now. `redirecting`: the
5048
+ * browser is on its way to the hosted page and the promise's caller should
5049
+ * do nothing more; the page comes back to `returnUrl`.
5050
+ */
5051
+ type ReverificationOutcome = 'recent' | 'redirecting';
5052
+ /** An error the server answered with `reauth_required`, as the SDK throws it. */
5053
+ interface ReauthRequiredError extends Error {
5054
+ status: 403;
5055
+ code: 'reauth_required';
5056
+ /** How recent a sign-in the change needs, in seconds. */
5057
+ maxAgeSeconds?: number;
5058
+ /** What the confirmation must include beyond signing in. */
5059
+ factors?: ReverifyFactor[];
5060
+ }
5061
+ /**
5062
+ * Whether an error from an SDK call is the server asking for a recent
5063
+ * sign-in. It is never a reason to sign out: re-confirm with
5064
+ * `requireReverification({ factors: error.factors })` and try again.
5065
+ */
5066
+ declare function isReauthRequired(error: unknown): error is ReauthRequiredError;
5067
+ /**
5068
+ * Whether an error is the server refusing a change because an app owner is
5069
+ * viewing as the user, read-only. Its message says so; show it.
5070
+ */
5071
+ declare function isReadOnlySession(error: unknown): boolean;
5072
+ /**
5073
+ * Whether an error is the server refusing a sign-in change (email, phone,
5074
+ * username, password, second step, passkeys, linked accounts, guest upgrade)
5075
+ * because an app owner is signed in as the user from the console, with full
5076
+ * access or read-only. Such a change would outlive the session, so it stays
5077
+ * the user's. Its message says so; show it. Never a reason to sign out or to
5078
+ * ask the user to confirm it's them.
5079
+ */
5080
+ declare function isImpersonationSignInLocked(error: unknown): boolean;
5081
+
5082
+ /**
5083
+ * A typed username as the server stores it (trimmed, lower case), or null
5084
+ * when it is not one: the wrong length or characters, two dots in a row, or
5085
+ * reserved.
5086
+ */
5087
+ declare function normaliseUsername(input: unknown): string | null;
5088
+ /** Whether `input` is a username the server would take, before asking it. */
5089
+ declare function isValidUsername(input: unknown): boolean;
5090
+
5091
+ /**
5092
+ * Connecting a crypto wallet to the signed-in account, dependency-free and testable without a browser: the
5093
+ * wallets are passed in, so a test hands over a fake.
5094
+ *
5095
+ * Injected wallets only: an EIP-1193 provider (`window.ethereum`) for
5096
+ * Ethereum and a Phantom-style `window.solana` for Solana. The wallet signs a
5097
+ * Sign-In with Ethereum message (EIP-4361), or its Solana sibling, built from
5098
+ * the nonce, domain, URI and time the server gave; the server checks all of
5099
+ * them, and the signature, before the wallet becomes a way in.
5100
+ */
5101
+
5102
+ /**
5103
+ * EIP-55: the address with its checksum casing, or null if it is not an
5104
+ * address. The server checksums the address in the message itself, so this
5105
+ * is for the message to read as wallets expect, not for the server.
5106
+ */
5107
+ declare function toChecksumAddress(address: unknown): string | null;
5108
+ /**
5109
+ * What the wallet is asked to agree to, as the message's statement line.
5110
+ * English on purpose: EIP-4361 allows only ASCII letters, digits, spaces and
5111
+ * a few marks there, so it cannot carry a translation.
5112
+ */
5113
+ declare const WALLET_LINK_STATEMENT = "Connect this wallet to your account.";
5114
+ /** What goes into the message, besides what the nonce answer gave. */
5115
+ interface WalletMessageInput {
5116
+ chain: WalletChain;
5117
+ /** From the nonce answer: the host the message is for. */
5118
+ domain: string;
5119
+ /** EIP-55 for Ethereum, base58 for Solana. */
5120
+ address: string;
5121
+ /** One line, ASCII. Defaults to `WALLET_LINK_STATEMENT`. */
5122
+ statement?: string;
5123
+ /** From the nonce answer. */
5124
+ uri: string;
5125
+ /** The EIP-155 chain id for Ethereum, the cluster (`mainnet`) for Solana. */
5126
+ chainId: number | string;
5127
+ /** From the nonce answer. */
5128
+ nonce: string;
5129
+ /** From the nonce answer. */
5130
+ issuedAt: string;
5131
+ }
5132
+ /**
5133
+ * The EIP-4361 message (or its Solana sibling, which only says "Solana
5134
+ * account" on the first line), laid out exactly as the server reads it:
5135
+ *
5136
+ * ```
5137
+ * {domain} wants you to sign in with your Ethereum account:
5138
+ * {address}
5139
+ *
5140
+ * {statement}
5141
+ *
5142
+ * URI: {uri}
5143
+ * Version: 1
5144
+ * Chain ID: {chainId}
5145
+ * Nonce: {nonce}
5146
+ * Issued At: {issuedAt}
5147
+ * ```
5148
+ *
5149
+ * The statement is always there: without one the standard's two blank lines
5150
+ * read as an empty statement to some parsers. A line break in any field would
5151
+ * make it a different message, so one is refused.
5152
+ */
5153
+ declare function buildWalletMessage(input: WalletMessageInput): string;
5154
+ /** An EIP-1193 provider, as wallets inject it at `window.ethereum`. */
5155
+ interface Eip1193Provider {
5156
+ request(args: {
5157
+ method: string;
5158
+ params?: unknown[] | Record<string, unknown>;
5159
+ }): Promise<unknown>;
5160
+ }
5161
+ /** A Solana wallet as Phantom (and wallets copying it) inject it at `window.solana`. */
5162
+ interface InjectedSolanaWallet {
5163
+ publicKey?: {
5164
+ toString(): string;
5165
+ } | null;
5166
+ connect(): Promise<{
5167
+ publicKey?: {
5168
+ toString(): string;
5169
+ } | null;
5170
+ } | void>;
5171
+ signMessage(message: Uint8Array, display?: 'utf8' | 'hex'): Promise<{
5172
+ signature: Uint8Array;
5173
+ } | Uint8Array>;
5174
+ }
5175
+ /**
5176
+ * Why connecting stopped on this side, before or instead of the server
5177
+ * answering. `no_wallet`: nothing injected for that chain. `rejected`: the
5178
+ * person said no in their wallet. `wallet_busy`: the wallet is already asking
5179
+ * them something. `wrong_network`: the wallet is on a chain the app does not
5180
+ * take and would not switch. `no_account`: the wallet gave no usable address.
5181
+ * `wallet_failed`: anything else the wallet did.
5182
+ */
5183
+ type WalletFlowErrorCode = 'no_wallet' | 'rejected' | 'wallet_busy' | 'wrong_network' | 'no_account' | 'wallet_failed';
5184
+ declare class WalletFlowError extends Error {
5185
+ readonly code: WalletFlowErrorCode;
5186
+ constructor(code: WalletFlowErrorCode, message: string);
5187
+ }
5188
+ /** The calls on `WorkspaceApi` that connecting a wallet makes. */
5189
+ interface WalletLinkApi {
5190
+ requestWalletNonce(chain: WalletChain): Promise<IWalletNonce>;
5191
+ linkWallet(input: IWalletLinkRequest): Promise<IConnectedAccount>;
5192
+ }
5193
+ /** What connecting a wallet needs. */
5194
+ interface ConnectWalletOptions {
5195
+ api: WalletLinkApi;
5196
+ /** The Ethereum wallet; defaults to the one the browser injected. */
5197
+ ethereum?: Eip1193Provider | null;
5198
+ /** The Solana wallet; defaults to the one the browser injected. */
5199
+ solana?: InjectedSolanaWallet | null;
5200
+ /**
5201
+ * The chain ids the app takes, from `getConnectedAccounts().wallet`, for a
5202
+ * nonce answer that does not list them.
5203
+ */
5204
+ ethereumChainIds?: number[];
5205
+ /** The message's statement line. Defaults to `WALLET_LINK_STATEMENT`. */
5206
+ statement?: string;
5207
+ }
5208
+ /**
5209
+ * Connect a wallet on `chain` to the signed-in account: ask the wallet for
5210
+ * its address, get a nonce, build the message from the nonce answer, have
5211
+ * the wallet sign it (moving an Ethereum wallet to a network the app takes
5212
+ * first, if it is on another), and send it. Resolves with the new row of
5213
+ * connected accounts.
5214
+ *
5215
+ * Throws a `WalletFlowError` when the wallet stops it (none injected, the
5216
+ * person said no, a network the app does not take), and the server's refusal
5217
+ * otherwise (`link_conflict`, `invalid_signature`, `nonce_expired` and the
5218
+ * rest of `WalletErrorCode`).
5219
+ */
5220
+ declare function connectWallet(chain: WalletChain, options: ConnectWalletOptions): Promise<IConnectedAccount>;
5221
+
3917
5222
  /**
3918
5223
  * The error an invitation call throws. A plain `Error` (so every existing
3919
5224
  * `catch (err) { err.message }` keeps working) carrying the server's fields
@@ -4161,15 +5466,61 @@ interface SDKUIConfig {
4161
5466
  * ```
4162
5467
  */
4163
5468
  sections?: Partial<Record<WorkspaceSettingsSection, boolean>>;
4164
- /** Profile screen — hide individual preference fields. */
5469
+ /** Profile screen: hide individual preference fields, or the change of email. */
4165
5470
  profile?: {
4166
5471
  language?: boolean;
4167
5472
  country?: boolean;
4168
5473
  currency?: boolean;
4169
5474
  timezone?: boolean;
5475
+ /**
5476
+ * The Change action on the email, and the note saying why it cannot be
5477
+ * changed. The change is also offered only while the server allows it
5478
+ * for the user.
5479
+ */
5480
+ changeEmail?: boolean;
5481
+ /**
5482
+ * The username field. It shows only while the app has usernames on or
5483
+ * the user has one, and never for a guest.
5484
+ */
5485
+ username?: boolean;
4170
5486
  };
4171
- /** Security screen — hide passkey row actions. */
5487
+ /**
5488
+ * Security screen: hide passkey row actions, the password, the phone
5489
+ * number, the two-step sign-in, the connected accounts (or only Connect a
5490
+ * wallet) or the Delete account section.
5491
+ */
4172
5492
  security?: {
5493
+ /** The change-password form. Hide it for an app without password sign-in. */
5494
+ password?: boolean;
5495
+ /**
5496
+ * The phone number section: add a number with a code, see it, remove it.
5497
+ * Hide it for an app without phone sign-in or text message codes. It
5498
+ * also hides itself against a server that predates phone numbers.
5499
+ */
5500
+ phone?: boolean;
5501
+ /**
5502
+ * The two-step sign-in (authenticator app) section. It also hides itself
5503
+ * while the app's organization has two-step sign-in turned off.
5504
+ */
5505
+ twoStep?: boolean;
5506
+ /**
5507
+ * The connected accounts section: the social sign-ins and wallets linked
5508
+ * to the user, with Remove, and a Connect button for each one the app
5509
+ * offers. It also hides itself while there is nothing to list or connect.
5510
+ */
5511
+ connectedAccounts?: boolean;
5512
+ /**
5513
+ * Connect a wallet, inside the connected accounts section, while the app
5514
+ * offers wallet sign-in. Wallets already connected are still listed.
5515
+ */
5516
+ wallets?: boolean;
5517
+ /**
5518
+ * The Delete account section: ask for the account to be deleted, and
5519
+ * cancel while it is scheduled. Also the notice at the top of every
5520
+ * screen of the dialog that says when a scheduled deletion runs, with
5521
+ * Cancel deletion.
5522
+ */
5523
+ deleteAccount?: boolean;
4173
5524
  passkeyRename?: boolean;
4174
5525
  passkeyDelete?: boolean;
4175
5526
  };
@@ -4225,6 +5576,12 @@ interface SDKUIConfig {
4225
5576
  pushToggles?: boolean;
4226
5577
  };
4227
5578
  };
5579
+ /**
5580
+ * The bar the provider pins to the bottom of the window while an app owner
5581
+ * is viewing the app as the signed-in person (default true). Set false to
5582
+ * place `<ImpersonationBanner fixed={false} />` in your own layout instead.
5583
+ */
5584
+ impersonationBanner?: boolean;
4228
5585
  /** Workspace switcher dialog (client-side; ANDed with server settings). */
4229
5586
  workspaceSwitcher?: {
4230
5587
  /** Overrides `settings.workspace.showSwitcher` to hide the switcher UI. */
@@ -4238,7 +5595,9 @@ interface SDKUIConfig {
4238
5595
  behavior?: {
4239
5596
  /**
4240
5597
  * Auto-open the plan picker dialog when a workspace has no
4241
- * subscription. Default true (current behavior).
5598
+ * subscription, and open Plan & Billing after `createWorkspace()`.
5599
+ * Default true. `false` turns both off; an explicit `selectPlan` deep
5600
+ * link still opens the picker.
4242
5601
  */
4243
5602
  autoOpenPlanDialog?: boolean;
4244
5603
  /** Default `daysThreshold` for `WhenTrialEnding` (default 3). */
@@ -4294,7 +5653,7 @@ declare const SUPPORTED_LOCALES: SDKLocale[];
4294
5653
  * ```tsx
4295
5654
  * const { t } = useTranslation();
4296
5655
  *
4297
- * // Simple lookup — autocomplete and compile-time typo checking
5656
+ * // Simple lookup: autocomplete and compile-time typo checking
4298
5657
  * t('settings.common.refresh') // → 'Refresh'
4299
5658
  *
4300
5659
  * // ICU interpolation with placeholders
@@ -4767,6 +6126,7 @@ type SignOutArg = SignOutOptions | {
4767
6126
  declare function useSaaSAuth(): {
4768
6127
  signIn: (returnUrl?: string) => Promise<void>;
4769
6128
  signOut: (options?: SignOutArg) => Promise<void>;
6129
+ requireReverification: (options?: RequireReverificationOptions) => Promise<ReverificationOutcome>;
4770
6130
  openWorkspaceSettings: (section?: WorkspaceSettingsSection) => void;
4771
6131
  openCreditStore: () => void;
4772
6132
  openPlanPicker: () => void;
@@ -4778,6 +6138,135 @@ declare function useSaaSAuth(): {
4778
6138
  status: AuthStatus;
4779
6139
  };
4780
6140
 
6141
+ interface GuestUpgradeProps {
6142
+ /** Extra classes for the root element. */
6143
+ className?: string;
6144
+ /** Heading text. Defaults to the translated title; set to null to hide. */
6145
+ title?: string | null;
6146
+ /** Sub-heading under the title. Defaults to the translated description; set to null to hide. */
6147
+ description?: string | null;
6148
+ /**
6149
+ * Called once the guest is an account: the profile the server answered, and
6150
+ * the address the account now has.
6151
+ */
6152
+ onUpgraded?: (result: {
6153
+ profile: IUser | null;
6154
+ email: string;
6155
+ }) => void;
6156
+ }
6157
+ /**
6158
+ * "Create your account" for a guest: the address (a name and a password are
6159
+ * optional), then the 6-digit code mailed to it. The guest keeps their id,
6160
+ * their data and this session, and `useSaaSAuth().user` is the account as
6161
+ * soon as the code is accepted. Renders nothing for someone who is not a
6162
+ * guest, apart from the confirmation right after they stopped being one.
6163
+ *
6164
+ * The Profile and Security screens show it in place of the email and the
6165
+ * password for a guest. For a custom UI, use `useGuestUpgrade()`.
6166
+ */
6167
+ declare function GuestUpgrade({ className, title, description, onUpgraded }: GuestUpgradeProps): React$1.JSX.Element | null;
6168
+
6169
+ interface ImpersonationBannerProps {
6170
+ /** Extra classes for the bar. */
6171
+ className?: string;
6172
+ /**
6173
+ * Pin the bar to the bottom of the window (the default, as the provider
6174
+ * renders it). False renders it in place, for an app that puts it in its
6175
+ * own layout.
6176
+ */
6177
+ fixed?: boolean;
6178
+ }
6179
+ /**
6180
+ * Says, for as long as it lasts, that an app owner is viewing the app as the
6181
+ * signed-in person: "You are viewing as Ada. Grace signed in as this person,
6182
+ * read-only until 3:15 PM." Exit signs out of that session. Renders nothing
6183
+ * in any other session.
6184
+ *
6185
+ * `SaaSOSProvider` renders it already, pinned to the bottom of the window;
6186
+ * hide that one with `ui.impersonationBanner: false` and place this yourself.
6187
+ */
6188
+ declare function ImpersonationBanner({ className, fixed }: ImpersonationBannerProps): React$1.JSX.Element | null;
6189
+
6190
+ /**
6191
+ * A guest becoming a real account, as
6192
+ * pure steps so `useGuestUpgrade` is testable without React: each step takes
6193
+ * the state and answers the next one, and never throws.
6194
+ *
6195
+ * Two steps, as changing email is: the address (with a name and a password
6196
+ * when given), then the 6-digit code mailed to it. The user id and everything
6197
+ * on it stay, and so does the session.
6198
+ */
6199
+
6200
+ /** Where the upgrade is: asking for the details, waiting for the code, or done. */
6201
+ type GuestUpgradeStep = 'details' | 'code' | 'done';
6202
+ /** A refusal, as the server worded it. */
6203
+ interface GuestUpgradeFailure {
6204
+ /**
6205
+ * The server's sentence, written to be shown. `useGuestUpgrade` gives a
6206
+ * translated one in its place when there is none, and when the server
6207
+ * could not be reached (`unreachable`).
6208
+ */
6209
+ message: string;
6210
+ status?: number;
6211
+ /** The server's reason: a `GuestUpgradeErrorCode`, or another refusal. */
6212
+ code?: string;
6213
+ /** The server never answered: offline, a proxy or gateway failed, or a timeout. */
6214
+ unreachable?: true;
6215
+ }
6216
+
6217
+ /** What `useGuestUpgrade` returns. */
6218
+ interface UseGuestUpgrade {
6219
+ /** The signed-in user is a guest (`useSaaSAuth().user.isAnonymous`). */
6220
+ isGuest: boolean;
6221
+ /** `details`: ask for the address. `code`: a code went to `email`. `done`: an account now. */
6222
+ step: GuestUpgradeStep;
6223
+ /** Where the code went, from the code step on. */
6224
+ email: string | null;
6225
+ /** The account the server answered, once `step` is `done`. */
6226
+ profile: IUser | null;
6227
+ /** What is in flight, for a button's progress. */
6228
+ pending: 'send' | 'resend' | 'confirm' | null;
6229
+ /**
6230
+ * The last refusal, with the server's sentence, or a translated one when
6231
+ * the server could not be reached or said nothing. Cleared by the next try.
6232
+ */
6233
+ error: GuestUpgradeFailure | null;
6234
+ /** Seconds before another code can be sent, counting down. */
6235
+ waitSeconds: number;
6236
+ /** The last code was a resend. */
6237
+ resent: boolean;
6238
+ /** Send a code to `input.email`. Resolves true when it went. */
6239
+ start: (input: IGuestUpgradeRequest) => Promise<boolean>;
6240
+ /** Send the code again, for the same details. */
6241
+ resend: () => Promise<boolean>;
6242
+ /** Become an account with the code. Resolves true when the user is one. */
6243
+ confirm: (code: string) => Promise<boolean>;
6244
+ /** Back to the details step. */
6245
+ reset: () => void;
6246
+ }
6247
+ /**
6248
+ * Turn a guest into a real account, keeping their id, data and session: the
6249
+ * address (with a name and a password, both optional), then the 6-digit code
6250
+ * mailed to it. On success `useSaaSAuth().user` is the account at once:
6251
+ * `isAnonymous` false, the address verified.
6252
+ *
6253
+ * Refusals keep the server's sentence (`email_unavailable`,
6254
+ * `signup_restricted`, `waitlist_required`, `signup_closed`,
6255
+ * `disposable_email`, `breached_password`, `cooldown` with a countdown,
6256
+ * `invalid_code`, `code_expired`); none of them signs the guest out.
6257
+ * `<GuestUpgrade />` is the ready-made form on top of this.
6258
+ *
6259
+ * @example
6260
+ * ```tsx
6261
+ * const upgrade = useGuestUpgrade();
6262
+ * if (!upgrade.isGuest) return null;
6263
+ * if (upgrade.step === 'details') {
6264
+ * return <button onClick={() => upgrade.start({ email })}>Send code</button>;
6265
+ * }
6266
+ * ```
6267
+ */
6268
+ declare function useGuestUpgrade(): UseGuestUpgrade;
6269
+
4781
6270
  type BuildBaseBadgeVariant = 'built-with' | 'powered-by' | 'mark';
4782
6271
  type BuildBaseBadgeTheme = 'auto' | 'light' | 'neutral' | 'dark';
4783
6272
  type BuildBaseBadgeSize = 'sm' | 'md' | 'lg';
@@ -5056,8 +6545,11 @@ interface UseConnectedAgents {
5056
6545
  revoking: string | null;
5057
6546
  /** Re-fetch the list. */
5058
6547
  refresh: () => Promise<void>;
5059
- /** Disconnect an agent, then optimistically drop it from the list. */
5060
- revoke: (clientId: string) => Promise<void>;
6548
+ /**
6549
+ * Disconnect an agent, then drop it from the list. Resolves true once it is
6550
+ * disconnected, false when it was not (the reason is in `error`).
6551
+ */
6552
+ revoke: (clientId: string) => Promise<boolean>;
5061
6553
  }
5062
6554
  /**
5063
6555
  * Headless data + actions for a "Connected agents" screen. Session-authed and
@@ -7723,6 +9215,11 @@ interface SectionHeaderProps {
7723
9215
  description?: string | null;
7724
9216
  /** Optional element aligned to the end of the title row (e.g. a badge or button). */
7725
9217
  actions?: React$1.ReactNode;
9218
+ /**
9219
+ * A help button (`FieldHelp`) right beside the title, or beside the
9220
+ * description when there is no title.
9221
+ */
9222
+ help?: React$1.ReactNode;
7726
9223
  className?: string;
7727
9224
  /** Extra classes for the title, e.g. `text-destructive` for danger sections. */
7728
9225
  titleClassName?: string;
@@ -7732,7 +9229,7 @@ interface SectionHeaderProps {
7732
9229
  * `h3 text-sm font-medium` title + muted `text-sm` description.
7733
9230
  * Renders nothing when both title and description are empty.
7734
9231
  */
7735
- declare function SectionHeader({ title, description, actions, className, titleClassName, }: SectionHeaderProps): React$1.JSX.Element | null;
9232
+ declare function SectionHeader({ title, description, actions, help, className, titleClassName, }: SectionHeaderProps): React$1.JSX.Element | null;
7736
9233
 
7737
9234
  interface SidebarNavSectionProps {
7738
9235
  /** Uppercase group label shown above the items. */
@@ -7763,8 +9260,12 @@ interface StatusBannerProps {
7763
9260
  variant: StatusBannerVariant;
7764
9261
  /** Bold first line, e.g. "Error loading subscription data". */
7765
9262
  title?: string;
7766
- /** Body text under the title (or standalone when there is no title). */
7767
- message?: string;
9263
+ /**
9264
+ * Body text under the title (or standalone when there is no title). Usually
9265
+ * a string; a node for text that needs its own semantics, such as a
9266
+ * countdown inside `role="timer"`, which is not read out on every tick.
9267
+ */
9268
+ message?: React$1.ReactNode;
7768
9269
  /** Small hint line under the message, e.g. "Retrying may resolve this." */
7769
9270
  description?: string;
7770
9271
  /** Optional leading icon, e.g. `<CheckCircle2 className="h-4 w-4 shrink-0" />`. */
@@ -7773,6 +9274,8 @@ interface StatusBannerProps {
7773
9274
  actionLabel?: string;
7774
9275
  onAction?: () => void;
7775
9276
  actionDisabled?: boolean;
9277
+ /** Shows the action as pending, with a spinner, and disables it while true. */
9278
+ actionProgress?: boolean;
7776
9279
  className?: string;
7777
9280
  }
7778
9281
  /**
@@ -7780,7 +9283,7 @@ interface StatusBannerProps {
7780
9283
  * with an optional Retry/Dismiss action. Use for every inline status box
7781
9284
  * so all screens share the same look.
7782
9285
  */
7783
- declare function StatusBanner({ variant, title, message, description, icon, actionLabel, onAction, actionDisabled, className, }: StatusBannerProps): React$1.JSX.Element;
9286
+ declare function StatusBanner({ variant, title, message, description, icon, actionLabel, onAction, actionDisabled, actionProgress, className, }: StatusBannerProps): React$1.JSX.Element;
7784
9287
 
7785
9288
  declare function WorkspaceSwitcher(props: {
7786
9289
  trigger: (isLoading: boolean, currentWorkspace: IWorkspace | null) => ReactNode;
@@ -7889,5 +9392,5 @@ declare class WorkspaceSettingsManager {
7889
9392
  }
7890
9393
  declare const workspaceSettingsManager: WorkspaceSettingsManager;
7891
9394
 
7892
- export { APP_PERMISSION_FALLBACK_GROUP, ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBaseBadge, SaaSOSProvider as BuildBaseProvider, CURRENCY_DISPLAY, CURRENCY_FLAG, ConnectMcpGuide, ConnectedAgents, ConnectedAgentsApi, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, Devices, DevicesApi, DunningState, EmptyState, EventEmitter, FALLBACK_WORKSPACE_ROLE, FullScreenLoader, INVITATION_ERROR_CODE, InvoiceStatuses, LoadingState, NotificationBell, NotificationInbox, NotificationsApi, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, PendingInvitations, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SectionHeader, Sessions, SessionsApi, SettingsApi, SettingsScreen, SidebarNavItem, SidebarNavSection, StatusBanner, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UPLOAD_ACCEPT, UPLOAD_MAX_BYTES, UploadsApi, UserApi, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPendingInvitations, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, actionableInvitations, appPermissionCatalogue, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, clearPendingInvite, coerceBadgeRef, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, fillMcpTemplate, formatCents, formatMinorAmountIntl, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, formatUploadLimit, getAvailableBillingIntervals, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyDecimals, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, inviterNameOf, isInvitationActionable, isInvitationError, isInvitationLapsed, isZeroDecimalCurrency, mcpServerKey, mergeUIConfig, minorAmountToDisplay, parkPendingInvite, pickDefaultRole, preflightUpload, readBBParams, readPendingInvite, resendCooldownSeconds, resolveMaxUsers, resolvePermissions, resolveRolePermissions, safeRedirect, saveAuthIntent, sortInvitations, uploadFailureOf, uploadPolicyOf, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConnectedAgents, useConnectedAgentsApi, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useDevices, useDevicesApi, useExpiringCredits, useFullScreenLoader, useInvoice, useInvoices, useMcpConnection, useMyInvitations, useNotifications, useNotificationsApi, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSessions, useSessionsApi, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUIConfig, useUIVisibility, useUpdateSubscription, useUpload, useUploadsApi, useUsageLogs, useUserAttributes, useUserFeatures, useWorkspaceInvitations, validateInvite, validateRedirectUrl, workspaceIdOf, workspaceNameOf, workspaceSettingsManager };
7893
- export type { BBActionType, BBScreenType, BBStatusType, BadgeHrefOptions, BetaFormData, BetaFormResponse, BillingInterval, BuildBaseBadgeProps, BuildBaseBadgeSize, BuildBaseBadgeTheme, BuildBaseBadgeVariant, SaaSOSProviderProps as BuildBaseProviderProps, CheckoutResult, ConnectMcpGuideProps, ConnectedAgentsProps, CreditActionsDetails, CreditBalanceContextValue, CreditBalanceDetails, CreditBucketSourceType, CreditBucketStatusType, CreditStorePageDetails, CreditTransactionTypeValue, DevicesProps, DunningStateType, EmptyStateProps, EventData, EventType, FormatQuotaWithPriceOptions, FullScreenLoaderProps, GetCheckoutStripeParams, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConnectedAgent, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IDeviceView, IEventCallbacks, IExpiringCreditsResponse, IInvoice, IInvoiceListResponse, IInvoiceResponse, IIpInfoLite, INotificationItem, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, ISessionView, ISettings, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUploadedFile, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, IUser, IWorkspace, IWorkspaceInvitation, IWorkspaceInvitationPreview, IWorkspaceInvitationStatus, InvitationError, InvitationErrorCode, InvitationErrorFields, InviteBlockReason, InviteValidation, InvoiceStatus, InvoiceStatusType, LoadingProps, LoadingStateProps, MaxUsersConfig, McpClientGuide, McpConnectionConfig, MyNotificationPreferences, NotificationBellProps, NotificationChannelPreference, NotificationCounts, NotificationData, NotificationEvent, NotificationInboxProps, NotificationListParams, NotificationPage, NotificationResult, NotificationScope, OnWorkspaceChangeParams, PartialSDKMessages, PendingInvitationsProps, PermissionContext, PermissionKey, PlanVersionWithPricingVariants, PricingPageDetails, PricingPageProps, QuotaDisplayValue, QuotaDisplayWithOverage, QuotaUsageContextValue, RedirectValidationOptions, Region, RolePermissionMap, SDKLocale, SDKMessages, SDKUIConfig, SaaSOSProviderProps, SeatStatus, SectionHeaderProps, SessionsProps, SettingsManagerState, SidebarNavItemProps, SidebarNavSectionProps, SignOutOptions, StatusBannerProps, StatusBannerVariant, SubscriptionContextValue, SubscriptionItemTypeValue, SubscriptionStatusType, TranslationKey, TrialStatus, UploadFailure, UploadOptions, UploadPolicy, UploadPurpose, UseConnectedAgents, UseDevices, UseMyInvitations, UseNotifications, UseNotificationsOptions, UseSessions, UseUpload, UseWorkspaceInvitations, UserCreatedEventData, UserUpdatedEventData, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceInvitationAcceptedEventData, WorkspaceInvitationDeclinedEventData, WorkspaceInvitationRevokedEventData, WorkspaceInvitationSentEventData, WorkspaceMemberPermissions, WorkspaceNotificationDefault, WorkspacePermissionDefinition, WorkspaceSettingsSection, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };
9395
+ export { APP_PERMISSION_FALLBACK_GROUP, ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBaseBadge, SaaSOSProvider as BuildBaseProvider, CURRENCY_DISPLAY, CURRENCY_FLAG, ConnectMcpGuide, ConnectedAgents, ConnectedAgentsApi, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, Devices, DevicesApi, DunningState, EmptyState, EventEmitter, FALLBACK_WORKSPACE_ROLE, FullScreenLoader, GuestUpgrade, INVITATION_ERROR_CODE, ImpersonationBanner, InvoiceStatuses, LoadingState, NotificationBell, NotificationInbox, NotificationsApi, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, PendingInvitations, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SectionHeader, Sessions, SessionsApi, SettingsApi, SettingsScreen, SidebarNavItem, SidebarNavSection, StatusBanner, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UPLOAD_ACCEPT, UPLOAD_MAX_BYTES, UploadsApi, UserApi, WALLET_LINK_STATEMENT, WalletFlowError, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPendingInvitations, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, actionableInvitations, appPermissionCatalogue, buildWalletMessage, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, clearPendingInvite, coerceBadgeRef, connectWallet, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, fillMcpTemplate, formatCents, formatMinorAmountIntl, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, formatUploadLimit, getAvailableBillingIntervals, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyDecimals, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, inviterNameOf, isImpersonationSignInLocked, isInvitationActionable, isInvitationError, isInvitationLapsed, isReadOnlySession, isReauthRequired, isValidUsername, isZeroDecimalCurrency, mcpServerKey, mergeUIConfig, minorAmountToDisplay, normaliseUsername, parkPendingInvite, pickDefaultRole, preflightUpload, readBBParams, readPendingInvite, resendCooldownSeconds, resolveMaxUsers, resolvePermissions, resolveRolePermissions, safeRedirect, saveAuthIntent, sortInvitations, toChecksumAddress, uploadFailureOf, uploadPolicyOf, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConnectedAgents, useConnectedAgentsApi, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useDevices, useDevicesApi, useExpiringCredits, useFullScreenLoader, useGuestUpgrade, useInvoice, useInvoices, useMcpConnection, useMyInvitations, useNotifications, useNotificationsApi, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSessions, useSessionsApi, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUIConfig, useUIVisibility, useUpdateSubscription, useUpload, useUploadsApi, useUsageLogs, useUserAttributes, useUserFeatures, useWorkspaceInvitations, validateInvite, validateRedirectUrl, workspaceIdOf, workspaceNameOf, workspaceSettingsManager };
9396
+ export type { AccountDeletionErrorCode, AccountLinkErrorReason, BBActionType, BBScreenType, BBStatusType, BadgeHrefOptions, BetaFormData, BetaFormResponse, BillingInterval, BuildBaseBadgeProps, BuildBaseBadgeSize, BuildBaseBadgeTheme, BuildBaseBadgeVariant, SaaSOSProviderProps as BuildBaseProviderProps, ChangeEmailBlockedBy, CheckoutResult, ConnectMcpGuideProps, ConnectWalletOptions, ConnectedAccountErrorCode, ConnectedAgentsProps, CreditActionsDetails, CreditBalanceContextValue, CreditBalanceDetails, CreditBucketSourceType, CreditBucketStatusType, CreditStorePageDetails, CreditTransactionTypeValue, DevicesProps, DunningStateType, Eip1193Provider, EmailChangeErrorCode, EmptyStateProps, EventData, EventType, FormatQuotaWithPriceOptions, FullScreenLoaderProps, GetCheckoutStripeParams, GuestUpgradeErrorCode, GuestUpgradeFailure, GuestUpgradeProps, GuestUpgradeStep, IAccountDeletion, IAccountLinkStart, IAllQuotaUsageResponse, IAvailableAccountProvider, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConnectedAccount, IConnectedAccounts, IConnectedAgent, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IDeviceView, IEmailChangeRequest, IEmailChangeResult, IEventCallbacks, IExpiringCreditsResponse, IGuestUpgradeRequest, IGuestUpgradeStarted, IImpersonation, IInvoice, IInvoiceListResponse, IInvoiceResponse, IIpInfoLite, IMfaBackupCodes, IMfaSmsStatus, IMfaStatus, INotificationItem, IOsConfig, IOsState, IOwnedWorkspace, IPhoneCodeSent, IPhoneConfirmed, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, IRequestOptions, IReverificationStart, ISessionView, ISettings, ISmsEnrollmentResult, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, ITotpEnrollment, IUploadedFile, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, IUser, IUsernamePolicy, IWalletLinkRequest, IWalletNonce, IWalletOptions, IWorkspace, IWorkspaceInvitation, IWorkspaceInvitationPreview, IWorkspaceInvitationStatus, ImpersonationBannerProps, InjectedSolanaWallet, InvitationError, InvitationErrorCode, InvitationErrorFields, InviteBlockReason, InviteValidation, InvoiceStatus, InvoiceStatusType, LoadingProps, LoadingStateProps, MaxUsersConfig, McpClientGuide, McpConnectionConfig, MfaEnforcement, MfaErrorCode, MfaFactorType, MyNotificationPreferences, NotificationBellProps, NotificationChannelPreference, NotificationCounts, NotificationData, NotificationEvent, NotificationInboxProps, NotificationListParams, NotificationPage, NotificationResult, NotificationScope, OnWorkspaceChangeParams, PartialSDKMessages, PasswordChangeErrorCode, PendingInvitationsProps, PermissionContext, PermissionKey, PhoneChannel, PhoneErrorCode, PlanVersionWithPricingVariants, PricingPageDetails, PricingPageProps, QuotaDisplayValue, QuotaDisplayWithOverage, QuotaUsageContextValue, ReauthRequiredError, RedirectValidationOptions, Region, RequireReverificationOptions, ReverificationOutcome, ReverifyErrorCode, ReverifyFactor, RolePermissionMap, SDKLocale, SDKMessages, SDKUIConfig, SaaSOSProviderProps, SeatStatus, SectionHeaderProps, SessionRefusalCode, SessionsProps, SettingsManagerState, SidebarNavItemProps, SidebarNavSectionProps, SignOutOptions, StatusBannerProps, StatusBannerVariant, SubscriptionContextValue, SubscriptionItemTypeValue, SubscriptionStatusType, TranslationKey, TrialStatus, UploadFailure, UploadOptions, UploadPolicy, UploadPurpose, UseConnectedAgents, UseDevices, UseGuestUpgrade, UseMyInvitations, UseNotifications, UseNotificationsOptions, UseSessions, UseUpload, UseWorkspaceInvitations, UserCreatedEventData, UserUpdatedEventData, UsernameErrorCode, WalletChain, WalletErrorCode, WalletFlowErrorCode, WalletLinkApi, WalletMessageInput, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceInvitationAcceptedEventData, WorkspaceInvitationDeclinedEventData, WorkspaceInvitationRevokedEventData, WorkspaceInvitationSentEventData, WorkspaceMemberPermissions, WorkspaceNotificationDefault, WorkspacePermissionDefinition, WorkspaceSettingsSection, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };