@supertokens-plugins/rownd-nodejs 0.2.0 → 0.3.0-beta.0
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.
- package/README.md +20 -0
- package/dist/bulkMigrate.js +1096 -0
- package/dist/cli.js +54 -0
- package/dist/generateAppConfig.js +731 -0
- package/dist/index.d.mts +826 -0
- package/dist/index.d.ts +826 -0
- package/dist/index.js +2752 -0
- package/dist/index.mjs +2732 -0
- package/dist/initConfig.js +136 -0
- package/dist/setupCoreInstance.js +295 -0
- package/package.json +13 -10
- package/scripts/bulkMigrate.ts +0 -450
- package/scripts/config.yaml +0 -27
- package/src/constants.ts +0 -5
- package/src/errors.ts +0 -13
- package/src/index.ts +0 -7
- package/src/logger.ts +0 -7
- package/src/plugin.test.ts +0 -790
- package/src/plugin.ts +0 -189
- package/src/pluginImplementation.ts +0 -187
- package/src/telemetry/axiomTelemetryClient.ts +0 -34
- package/src/telemetry/createTelemetryClient.ts +0 -87
- package/src/telemetry/openTelemetryClient.ts +0 -32
- package/src/types.ts +0 -124
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import * as SuperTokens from 'supertokens-node';
|
|
2
|
+
import { JSONObject, SuperTokensPlugin } from 'supertokens-node/types';
|
|
3
|
+
|
|
4
|
+
type RowndSignInMethod = {
|
|
5
|
+
/**
|
|
6
|
+
* Enables email passwordless sign-in.
|
|
7
|
+
* @default Disabled when omitted.
|
|
8
|
+
*/
|
|
9
|
+
method: "email";
|
|
10
|
+
} | {
|
|
11
|
+
/**
|
|
12
|
+
* Enables phone passwordless sign-in.
|
|
13
|
+
* @default Disabled when omitted.
|
|
14
|
+
*/
|
|
15
|
+
method: "phone";
|
|
16
|
+
} | {
|
|
17
|
+
/**
|
|
18
|
+
* Enables Sign in with Apple.
|
|
19
|
+
* @default Disabled when omitted.
|
|
20
|
+
*/
|
|
21
|
+
method: "apple";
|
|
22
|
+
/**
|
|
23
|
+
* Apple Services ID used by the hub Apple sign-in script.
|
|
24
|
+
* @default ""
|
|
25
|
+
*/
|
|
26
|
+
clientId?: string;
|
|
27
|
+
} | {
|
|
28
|
+
/**
|
|
29
|
+
* Enables Sign in with Google.
|
|
30
|
+
* @default Disabled when omitted.
|
|
31
|
+
*/
|
|
32
|
+
method: "google";
|
|
33
|
+
/**
|
|
34
|
+
* Google web client ID used by the hub and Google scripts.
|
|
35
|
+
* @default ""
|
|
36
|
+
*/
|
|
37
|
+
clientId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Google iOS client ID used by mobile-app flows.
|
|
40
|
+
* @default ""
|
|
41
|
+
*/
|
|
42
|
+
iosClientId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Extra OAuth scopes requested by Google sign-in.
|
|
45
|
+
* @default []
|
|
46
|
+
*/
|
|
47
|
+
scopes?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Enables Rownd's faster Google sign-in prompt for supported email domains.
|
|
50
|
+
* @default "enabled"
|
|
51
|
+
*/
|
|
52
|
+
signInFasterWithGoogle?: "enabled" | "disabled";
|
|
53
|
+
/**
|
|
54
|
+
* Google One Tap prompt settings.
|
|
55
|
+
* @default autoPrompt false and 7000ms delay per platform.
|
|
56
|
+
*/
|
|
57
|
+
oneTap?: {
|
|
58
|
+
browser?: {
|
|
59
|
+
/**
|
|
60
|
+
* Whether the browser hub should automatically show One Tap.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
autoPrompt?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Delay before the browser One Tap prompt is shown, in milliseconds.
|
|
66
|
+
* @default 7000
|
|
67
|
+
*/
|
|
68
|
+
delay?: number;
|
|
69
|
+
};
|
|
70
|
+
mobileApp?: {
|
|
71
|
+
/**
|
|
72
|
+
* Whether mobile-app integrations should automatically show One Tap.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
autoPrompt?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Delay before the mobile-app One Tap prompt is shown, in milliseconds.
|
|
78
|
+
* @default 7000
|
|
79
|
+
*/
|
|
80
|
+
delay?: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
/**
|
|
85
|
+
* Enables guest/instant-user sign-in.
|
|
86
|
+
* @default Disabled when omitted.
|
|
87
|
+
*/
|
|
88
|
+
method: "anonymous";
|
|
89
|
+
/**
|
|
90
|
+
* Anonymous sign-in mode. "instant" emits Rownd instant-user config instead of the guest button.
|
|
91
|
+
* @default "guest"
|
|
92
|
+
*/
|
|
93
|
+
type?: "guest" | "instant";
|
|
94
|
+
/**
|
|
95
|
+
* Button label for anonymous sign-in.
|
|
96
|
+
* @default "Continue as a guest"
|
|
97
|
+
*/
|
|
98
|
+
displayName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Light-mode icon URL for the anonymous sign-in button.
|
|
101
|
+
* @default Built-in icon.
|
|
102
|
+
*/
|
|
103
|
+
iconLightUrl?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Dark-mode icon URL for the anonymous sign-in button.
|
|
106
|
+
* @default iconLightUrl or the built-in icon.
|
|
107
|
+
*/
|
|
108
|
+
iconDarkUrl?: string;
|
|
109
|
+
} | {
|
|
110
|
+
/**
|
|
111
|
+
* Enables a custom OAuth2 provider under this method key.
|
|
112
|
+
* @default Disabled when omitted.
|
|
113
|
+
*/
|
|
114
|
+
method: string;
|
|
115
|
+
/**
|
|
116
|
+
* Provider display name in the sign-in button.
|
|
117
|
+
* @default method
|
|
118
|
+
*/
|
|
119
|
+
displayName?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Light-mode provider icon URL for the sign-in button.
|
|
122
|
+
* @default No custom icon.
|
|
123
|
+
*/
|
|
124
|
+
iconLightUrl?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Dark-mode provider icon URL for the sign-in button.
|
|
127
|
+
* @default iconLightUrl or no custom icon.
|
|
128
|
+
*/
|
|
129
|
+
iconDarkUrl?: string;
|
|
130
|
+
/** Additional provider-specific config retained for future Rownd-compatible options. */
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
type RowndBranding = {
|
|
134
|
+
/**
|
|
135
|
+
* Primary hub color in light mode.
|
|
136
|
+
* @default "#5b5bd6"
|
|
137
|
+
*/
|
|
138
|
+
primaryColor?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Primary hub color in dark mode.
|
|
141
|
+
* @default "#c8aaff"
|
|
142
|
+
*/
|
|
143
|
+
primaryColorDarkMode?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Light-mode logo URL.
|
|
146
|
+
* @default appConfig.icon
|
|
147
|
+
*/
|
|
148
|
+
logo?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Dark-mode logo URL.
|
|
151
|
+
* @default logo, then appConfig.icon
|
|
152
|
+
*/
|
|
153
|
+
logoDarkMode?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Raw Rownd animation asset/config overrides.
|
|
156
|
+
* @default undefined
|
|
157
|
+
*/
|
|
158
|
+
animations?: JSONObject;
|
|
159
|
+
/**
|
|
160
|
+
* Whether hub controls use rounded corners.
|
|
161
|
+
* @default true
|
|
162
|
+
*/
|
|
163
|
+
roundedCorners?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Radius in pixels applied to hub containers and controls. Hub caps it at 30px.
|
|
166
|
+
* @default undefined
|
|
167
|
+
*/
|
|
168
|
+
containerBorderRadius?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Floating launcher placement, such as "bottom-left" or "hidden".
|
|
171
|
+
* @default "bottom-left"
|
|
172
|
+
*/
|
|
173
|
+
placement?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Hub-specific primary color override.
|
|
176
|
+
* @default primaryColor
|
|
177
|
+
*/
|
|
178
|
+
hubPrimaryColor?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Hub background color override.
|
|
181
|
+
* @default undefined
|
|
182
|
+
*/
|
|
183
|
+
backgroundColor?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Hub font family override.
|
|
186
|
+
* @default undefined
|
|
187
|
+
*/
|
|
188
|
+
fontFamily?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Hides Rownd verification icons in hub UI.
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
hideVerificationIcons?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Whether decorative swoops are shown on sign-in and wallet screens.
|
|
196
|
+
* @default true
|
|
197
|
+
*/
|
|
198
|
+
visualSwoops?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Whether modal background blur is enabled.
|
|
201
|
+
* @default true
|
|
202
|
+
*/
|
|
203
|
+
blurBackground?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Opacity applied to the modal background blur.
|
|
206
|
+
* @default undefined
|
|
207
|
+
*/
|
|
208
|
+
blurBackgroundOpacity?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Horizontal launcher offset in pixels.
|
|
211
|
+
* @default undefined
|
|
212
|
+
*/
|
|
213
|
+
offsetX?: number;
|
|
214
|
+
/**
|
|
215
|
+
* Vertical launcher offset in pixels.
|
|
216
|
+
* @default undefined
|
|
217
|
+
*/
|
|
218
|
+
offsetY?: number;
|
|
219
|
+
/**
|
|
220
|
+
* Raw CSS variable/property overrides consumed by Rownd hub.
|
|
221
|
+
* @default undefined
|
|
222
|
+
*/
|
|
223
|
+
propertyOverrides?: JSONObject;
|
|
224
|
+
/**
|
|
225
|
+
* Hub color mode.
|
|
226
|
+
* @default "auto"
|
|
227
|
+
*/
|
|
228
|
+
darkMode?: "auto" | "light" | "dark";
|
|
229
|
+
/**
|
|
230
|
+
* Whether the app icon/logo appears inside sign-in and profile modals.
|
|
231
|
+
* @default false
|
|
232
|
+
*/
|
|
233
|
+
showAppIcon?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Raw CSS snippets injected into the hub document.
|
|
236
|
+
* @default []
|
|
237
|
+
*/
|
|
238
|
+
customStyles?: {
|
|
239
|
+
/** CSS text injected into a style tag. */
|
|
240
|
+
content: string;
|
|
241
|
+
}[];
|
|
242
|
+
/**
|
|
243
|
+
* Raw script snippets injected into the hub document.
|
|
244
|
+
* @default []
|
|
245
|
+
*/
|
|
246
|
+
customScripts?: {
|
|
247
|
+
/** Script MIME type. */
|
|
248
|
+
type?: string;
|
|
249
|
+
/** Script text injected into a script tag. */
|
|
250
|
+
content: string;
|
|
251
|
+
}[];
|
|
252
|
+
};
|
|
253
|
+
type RowndLegal = {
|
|
254
|
+
/**
|
|
255
|
+
* Company name shown in legal copy.
|
|
256
|
+
* @default appConfig.name
|
|
257
|
+
*/
|
|
258
|
+
companyName?: string;
|
|
259
|
+
/**
|
|
260
|
+
* Privacy policy link shown in legal/footer components.
|
|
261
|
+
* @default ""
|
|
262
|
+
*/
|
|
263
|
+
privacyPolicyUrl?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Terms and conditions link shown in legal/footer components.
|
|
266
|
+
* @default ""
|
|
267
|
+
*/
|
|
268
|
+
termsConditionsUrl?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Support address used in error and profile support links.
|
|
271
|
+
* @default Rownd support email.
|
|
272
|
+
*/
|
|
273
|
+
supportEmail?: string;
|
|
274
|
+
};
|
|
275
|
+
type RowndAuthConfig = {
|
|
276
|
+
/**
|
|
277
|
+
* Whether the hub should preselect the user's previous sign-in method.
|
|
278
|
+
* @default true
|
|
279
|
+
*/
|
|
280
|
+
rememberSignInMethod?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Enables separate sign-in/sign-up intent flows.
|
|
283
|
+
* @default false
|
|
284
|
+
*/
|
|
285
|
+
useExplicitSignUpFlow?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Allows new users to authenticate before completing verification.
|
|
288
|
+
* @default false
|
|
289
|
+
*/
|
|
290
|
+
allowUnverifiedUsers?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Verification email customization.
|
|
293
|
+
* @default Rownd/SuperTokens email defaults.
|
|
294
|
+
*/
|
|
295
|
+
email?: {
|
|
296
|
+
fromAddress?: string;
|
|
297
|
+
image?: string;
|
|
298
|
+
subject?: string;
|
|
299
|
+
callToActionText?: string;
|
|
300
|
+
verifyTemplate?: string;
|
|
301
|
+
customContent?: string;
|
|
302
|
+
customClosingContent?: string;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Mobile app install/interstitial customization for magic links.
|
|
306
|
+
* @default Rownd hub built-in mobile copy.
|
|
307
|
+
*/
|
|
308
|
+
mobile?: {
|
|
309
|
+
title?: string;
|
|
310
|
+
image?: string;
|
|
311
|
+
callToActionText?: string;
|
|
312
|
+
hyperlinkText?: string;
|
|
313
|
+
hyperlinkRedirectUrl?: string;
|
|
314
|
+
customContent?: string;
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Method to use first for explicit sign-up.
|
|
318
|
+
* @default The only visible ordered method, when there is exactly one.
|
|
319
|
+
*/
|
|
320
|
+
primarySignUpMethod?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Preferred identifier input when no auth order is provided.
|
|
323
|
+
* @default First ordered input, then "email".
|
|
324
|
+
*/
|
|
325
|
+
preferredMethod?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Per-platform sign-in button/input ordering.
|
|
328
|
+
* @default Rownd hub's built-in method order.
|
|
329
|
+
*/
|
|
330
|
+
order?: {
|
|
331
|
+
/**
|
|
332
|
+
* Browser/default ordering. Each entry names an auth method and whether it renders as a button or input.
|
|
333
|
+
* @default undefined
|
|
334
|
+
*/
|
|
335
|
+
default?: {
|
|
336
|
+
/** Whether the method renders as a button or identifier input. */
|
|
337
|
+
type: "button" | "input";
|
|
338
|
+
/** Sign-in method key, for example email, phone, google, apple, anonymous, or a custom provider key. */
|
|
339
|
+
name: string;
|
|
340
|
+
/**
|
|
341
|
+
* Hides the method from the initial sign-up view; sign-in flows can still show it.
|
|
342
|
+
* @default false
|
|
343
|
+
*/
|
|
344
|
+
hidden?: boolean;
|
|
345
|
+
}[];
|
|
346
|
+
/**
|
|
347
|
+
* iOS webview ordering.
|
|
348
|
+
* @default default
|
|
349
|
+
*/
|
|
350
|
+
ios?: {
|
|
351
|
+
/** Whether the method renders as a button or identifier input. */
|
|
352
|
+
type: "button" | "input";
|
|
353
|
+
/** Sign-in method key, for example email, phone, google, apple, anonymous, or a custom provider key. */
|
|
354
|
+
name: string;
|
|
355
|
+
/**
|
|
356
|
+
* Hides the method from the initial sign-up view; sign-in flows can still show it.
|
|
357
|
+
* @default false
|
|
358
|
+
*/
|
|
359
|
+
hidden?: boolean;
|
|
360
|
+
}[];
|
|
361
|
+
/**
|
|
362
|
+
* Android webview ordering.
|
|
363
|
+
* @default default
|
|
364
|
+
*/
|
|
365
|
+
android?: {
|
|
366
|
+
/** Whether the method renders as a button or identifier input. */
|
|
367
|
+
type: "button" | "input";
|
|
368
|
+
/** Sign-in method key, for example email, phone, google, apple, anonymous, or a custom provider key. */
|
|
369
|
+
name: string;
|
|
370
|
+
/**
|
|
371
|
+
* Hides the method from the initial sign-up view; sign-in flows can still show it.
|
|
372
|
+
* @default false
|
|
373
|
+
*/
|
|
374
|
+
hidden?: boolean;
|
|
375
|
+
}[];
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Extra fields collected during sign-in/sign-up.
|
|
379
|
+
* @default []
|
|
380
|
+
*/
|
|
381
|
+
additionalFields?: {
|
|
382
|
+
/** User data key posted with the collected value. */
|
|
383
|
+
name: string;
|
|
384
|
+
/** Input renderer type, for example input, text, tel, email, or select. */
|
|
385
|
+
type: string;
|
|
386
|
+
/** Label shown next to the field. */
|
|
387
|
+
label: string;
|
|
388
|
+
/**
|
|
389
|
+
* Placeholder shown for text-like inputs.
|
|
390
|
+
* @default undefined
|
|
391
|
+
*/
|
|
392
|
+
placeholder?: string;
|
|
393
|
+
/**
|
|
394
|
+
* Select/radio choices. For option-based fields, the first option is the default when no value is provided.
|
|
395
|
+
* @default First option value.
|
|
396
|
+
*/
|
|
397
|
+
options: {
|
|
398
|
+
/** Submitted value for this option. */
|
|
399
|
+
value: string;
|
|
400
|
+
/** Label shown to the user for this option. */
|
|
401
|
+
label: string;
|
|
402
|
+
}[];
|
|
403
|
+
}[];
|
|
404
|
+
};
|
|
405
|
+
type RowndProfileConfig = {
|
|
406
|
+
/**
|
|
407
|
+
* Controls which account identifiers/sign-in methods are shown in the profile account section.
|
|
408
|
+
* @default All visible user-facing account fields.
|
|
409
|
+
*/
|
|
410
|
+
accountInformation?: {
|
|
411
|
+
/**
|
|
412
|
+
* Per-method visibility.
|
|
413
|
+
* @default Each method enabled when omitted.
|
|
414
|
+
*/
|
|
415
|
+
methods?: Record<string, {
|
|
416
|
+
/**
|
|
417
|
+
* Whether the method/account identifier is visible.
|
|
418
|
+
* @default true
|
|
419
|
+
*/
|
|
420
|
+
enabled?: boolean;
|
|
421
|
+
}>;
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Shows the personal information profile section.
|
|
425
|
+
* @default true
|
|
426
|
+
*/
|
|
427
|
+
personalInformation?: {
|
|
428
|
+
/**
|
|
429
|
+
* Whether the section is visible.
|
|
430
|
+
* @default true
|
|
431
|
+
*/
|
|
432
|
+
enabled?: boolean;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Shows the preferences/support profile section.
|
|
436
|
+
* @default true
|
|
437
|
+
*/
|
|
438
|
+
preferences?: {
|
|
439
|
+
/**
|
|
440
|
+
* Whether the section is visible.
|
|
441
|
+
* @default true
|
|
442
|
+
*/
|
|
443
|
+
enabled?: boolean;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Shows the sign-out button in the profile modal.
|
|
447
|
+
* @default true
|
|
448
|
+
*/
|
|
449
|
+
signOutButton?: {
|
|
450
|
+
/**
|
|
451
|
+
* Whether the button is visible.
|
|
452
|
+
* @default true
|
|
453
|
+
*/
|
|
454
|
+
enabled?: boolean;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Shows the delete-account action in preferences.
|
|
458
|
+
* @default false
|
|
459
|
+
*/
|
|
460
|
+
deleteAccountButton?: {
|
|
461
|
+
/**
|
|
462
|
+
* Whether the delete-account action is visible.
|
|
463
|
+
* @default false
|
|
464
|
+
*/
|
|
465
|
+
enabled?: boolean;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Shows the add sign-in methods action in the profile modal.
|
|
469
|
+
* @default true
|
|
470
|
+
*/
|
|
471
|
+
addSignInMethodsButton?: {
|
|
472
|
+
/** Whether the button is visible. */
|
|
473
|
+
enabled?: boolean;
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
type RowndCustomContent = {
|
|
477
|
+
/**
|
|
478
|
+
* Text overrides for the sign-in modal.
|
|
479
|
+
* @default Rownd hub built-in copy.
|
|
480
|
+
*/
|
|
481
|
+
signInModal?: {
|
|
482
|
+
/**
|
|
483
|
+
* Main modal title. Can be overridden per requestSignIn call.
|
|
484
|
+
* @default Rownd hub built-in title.
|
|
485
|
+
*/
|
|
486
|
+
title?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Main modal subtitle.
|
|
489
|
+
* @default Rownd hub built-in subtitle.
|
|
490
|
+
*/
|
|
491
|
+
subtitle?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Title when explicit sign-in intent is active.
|
|
494
|
+
* @default Rownd hub built-in sign-in title.
|
|
495
|
+
*/
|
|
496
|
+
signInTitle?: string;
|
|
497
|
+
/**
|
|
498
|
+
* Title when explicit sign-up intent is active.
|
|
499
|
+
* @default Rownd hub built-in sign-up title.
|
|
500
|
+
*/
|
|
501
|
+
signUpTitle?: string;
|
|
502
|
+
/**
|
|
503
|
+
* Subtitle when explicit sign-in intent is active.
|
|
504
|
+
* @default Rownd hub built-in sign-in subtitle.
|
|
505
|
+
*/
|
|
506
|
+
signInSubtitle?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Subtitle when explicit sign-up intent is active.
|
|
509
|
+
* @default Rownd hub built-in sign-up subtitle.
|
|
510
|
+
*/
|
|
511
|
+
signUpSubtitle?: string;
|
|
512
|
+
/**
|
|
513
|
+
* Explicit sign-in CTA text.
|
|
514
|
+
* @default Rownd hub built-in sign-in button text.
|
|
515
|
+
*/
|
|
516
|
+
signInButton?: string;
|
|
517
|
+
/**
|
|
518
|
+
* Explicit sign-up CTA text.
|
|
519
|
+
* @default Rownd hub built-in sign-up button text.
|
|
520
|
+
*/
|
|
521
|
+
signUpButton?: string;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* Profile modal text overrides.
|
|
525
|
+
* @default Rownd hub built-in profile copy.
|
|
526
|
+
*/
|
|
527
|
+
profileModal?: {
|
|
528
|
+
/**
|
|
529
|
+
* Profile modal title.
|
|
530
|
+
* @default "Your profile"
|
|
531
|
+
*/
|
|
532
|
+
title?: string;
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* Verification modal text overrides.
|
|
536
|
+
* @default Rownd hub built-in verification copy.
|
|
537
|
+
*/
|
|
538
|
+
verificationModal?: {
|
|
539
|
+
/**
|
|
540
|
+
* Verification modal title.
|
|
541
|
+
* @default Rownd hub built-in verification title.
|
|
542
|
+
*/
|
|
543
|
+
title?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Verification modal subtitle.
|
|
546
|
+
* @default Rownd hub built-in verification subtitle.
|
|
547
|
+
*/
|
|
548
|
+
subtitle?: string;
|
|
549
|
+
};
|
|
550
|
+
/**
|
|
551
|
+
* Sign-in failure modal text overrides.
|
|
552
|
+
* @default Rownd hub built-in error copy.
|
|
553
|
+
*/
|
|
554
|
+
signInFailureModal?: {
|
|
555
|
+
/**
|
|
556
|
+
* Message shown when sign-in fails.
|
|
557
|
+
* @default Rownd hub built-in error copy.
|
|
558
|
+
*/
|
|
559
|
+
failureMessage?: string;
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* No-account modal text overrides.
|
|
563
|
+
* @default Rownd hub built-in copy.
|
|
564
|
+
*/
|
|
565
|
+
noAccountMessage?: {
|
|
566
|
+
/** No-account modal title. */
|
|
567
|
+
title?: string;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Raw mobile custom content config consumed by Rownd hub.
|
|
571
|
+
* @default undefined
|
|
572
|
+
*/
|
|
573
|
+
mobile?: JSONObject;
|
|
574
|
+
};
|
|
575
|
+
type RowndAppConfigInput = {
|
|
576
|
+
/**
|
|
577
|
+
* Rownd app ID returned by the app-config endpoint.
|
|
578
|
+
* @default ""
|
|
579
|
+
*/
|
|
580
|
+
id?: string;
|
|
581
|
+
/**
|
|
582
|
+
* App display name used in the hub UI and legal fallback copy.
|
|
583
|
+
* @default SuperTokens appInfo.appName
|
|
584
|
+
*/
|
|
585
|
+
name?: string;
|
|
586
|
+
/**
|
|
587
|
+
* App icon URL used as the fallback logo/favicon.
|
|
588
|
+
* @default ""
|
|
589
|
+
*/
|
|
590
|
+
icon?: string;
|
|
591
|
+
/**
|
|
592
|
+
* User profile fields that can verify a user.
|
|
593
|
+
* @default Rownd hub defaults.
|
|
594
|
+
*/
|
|
595
|
+
userVerificationFields?: string[];
|
|
596
|
+
/**
|
|
597
|
+
* Visual customization for the hub UI.
|
|
598
|
+
* @default Defaults documented in RowndBranding.
|
|
599
|
+
*/
|
|
600
|
+
branding?: RowndBranding;
|
|
601
|
+
/**
|
|
602
|
+
* Native/web app capability metadata from Rownd.
|
|
603
|
+
* @default undefined
|
|
604
|
+
*/
|
|
605
|
+
capabilities?: JSONObject;
|
|
606
|
+
/**
|
|
607
|
+
* Browser/web app config from Rownd.
|
|
608
|
+
* @default undefined
|
|
609
|
+
*/
|
|
610
|
+
web?: JSONObject;
|
|
611
|
+
/**
|
|
612
|
+
* Bottom sheet config from Rownd.
|
|
613
|
+
* @default undefined
|
|
614
|
+
*/
|
|
615
|
+
bottomSheet?: JSONObject;
|
|
616
|
+
/**
|
|
617
|
+
* Rownd profile storage version metadata.
|
|
618
|
+
* @default undefined
|
|
619
|
+
*/
|
|
620
|
+
profileStorageVersion?: string;
|
|
621
|
+
/**
|
|
622
|
+
* Allowed web origins metadata from Rownd hub config.
|
|
623
|
+
* @default undefined
|
|
624
|
+
*/
|
|
625
|
+
allowedWebOrigins?: string[];
|
|
626
|
+
/**
|
|
627
|
+
* Legal links and support contact shown in hub flows.
|
|
628
|
+
* @default Defaults documented in RowndLegal.
|
|
629
|
+
*/
|
|
630
|
+
legal?: RowndLegal;
|
|
631
|
+
/**
|
|
632
|
+
* Copy overrides for hub modals.
|
|
633
|
+
* @default Rownd hub built-in copy.
|
|
634
|
+
*/
|
|
635
|
+
customContent?: RowndCustomContent;
|
|
636
|
+
/**
|
|
637
|
+
* Profile modal feature visibility.
|
|
638
|
+
* @default Defaults documented in RowndProfileConfig.
|
|
639
|
+
*/
|
|
640
|
+
profile?: RowndProfileConfig;
|
|
641
|
+
/**
|
|
642
|
+
* Authentication flow options.
|
|
643
|
+
* @default Defaults documented in RowndAuthConfig.
|
|
644
|
+
*/
|
|
645
|
+
auth?: RowndAuthConfig;
|
|
646
|
+
/**
|
|
647
|
+
* Enabled sign-in methods.
|
|
648
|
+
* @default []
|
|
649
|
+
*/
|
|
650
|
+
signInMethods?: RowndSignInMethod[];
|
|
651
|
+
};
|
|
652
|
+
type RowndSubBrandConfigInput = RowndAppConfigInput & {
|
|
653
|
+
variant: {
|
|
654
|
+
id: string;
|
|
655
|
+
name?: string;
|
|
656
|
+
config?: JSONObject;
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
interface RowndPluginConfig {
|
|
660
|
+
rowndAppKey: string;
|
|
661
|
+
rowndAppSecret: string;
|
|
662
|
+
enableDebugLogs?: boolean;
|
|
663
|
+
telemetry?: RowndTelemetryConfig;
|
|
664
|
+
schema?: RowndSchema;
|
|
665
|
+
appConfig?: RowndAppConfigInput;
|
|
666
|
+
subBrands?: Record<string, RowndSubBrandConfigInput>;
|
|
667
|
+
}
|
|
668
|
+
type RowndTelemetryEvent = {
|
|
669
|
+
outcome: "success";
|
|
670
|
+
durationMs: number;
|
|
671
|
+
tenantId?: string;
|
|
672
|
+
rowndUserId?: string;
|
|
673
|
+
superTokensUserId?: string;
|
|
674
|
+
} | {
|
|
675
|
+
outcome: "error";
|
|
676
|
+
durationMs: number;
|
|
677
|
+
tenantId?: string;
|
|
678
|
+
rowndUserId?: string;
|
|
679
|
+
superTokensUserId?: string;
|
|
680
|
+
error: {
|
|
681
|
+
message: string;
|
|
682
|
+
name?: string;
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
interface RowndTelemetryClient {
|
|
686
|
+
recordEvent: (event: RowndTelemetryEvent) => Promise<void> | void;
|
|
687
|
+
}
|
|
688
|
+
type RowndTelemetryConfig = {
|
|
689
|
+
provider: "opentelemetry";
|
|
690
|
+
} | {
|
|
691
|
+
provider: "axiom";
|
|
692
|
+
token: string;
|
|
693
|
+
dataset: string;
|
|
694
|
+
url?: string;
|
|
695
|
+
} | {
|
|
696
|
+
provider: "custom";
|
|
697
|
+
factory: () => RowndTelemetryClient;
|
|
698
|
+
};
|
|
699
|
+
type RowndUser = JSONObject & {
|
|
700
|
+
state: string;
|
|
701
|
+
auth_level: string;
|
|
702
|
+
data: JSONObject & {
|
|
703
|
+
user_id: string;
|
|
704
|
+
email?: string;
|
|
705
|
+
phone_number?: string;
|
|
706
|
+
google_id?: string;
|
|
707
|
+
apple_id?: string;
|
|
708
|
+
first_name?: string;
|
|
709
|
+
last_name?: string;
|
|
710
|
+
};
|
|
711
|
+
attributes?: JSONObject;
|
|
712
|
+
verified_data: JSONObject & {
|
|
713
|
+
email?: string | boolean;
|
|
714
|
+
phone_number?: string | boolean;
|
|
715
|
+
google_id?: string | boolean;
|
|
716
|
+
apple_id?: string | boolean;
|
|
717
|
+
};
|
|
718
|
+
groups?: JSONObject[];
|
|
719
|
+
meta?: JSONObject;
|
|
720
|
+
};
|
|
721
|
+
type RowndUserMetadata = {
|
|
722
|
+
original_rownd_user?: RowndUser;
|
|
723
|
+
rownd_pending_verification?: Array<{
|
|
724
|
+
id: string;
|
|
725
|
+
field: string;
|
|
726
|
+
value: string;
|
|
727
|
+
created_at: string;
|
|
728
|
+
}>;
|
|
729
|
+
[key: string]: unknown;
|
|
730
|
+
};
|
|
731
|
+
interface MigrationResponse {
|
|
732
|
+
status: "OK" | "ERROR";
|
|
733
|
+
message?: string;
|
|
734
|
+
}
|
|
735
|
+
interface RowndPluginNormalisedConfig {
|
|
736
|
+
rowndAppKey: string;
|
|
737
|
+
rowndAppSecret: string;
|
|
738
|
+
enableDebugLogs?: boolean;
|
|
739
|
+
telemetry?: RowndTelemetryConfig;
|
|
740
|
+
schema?: RowndSchema;
|
|
741
|
+
appConfig?: RowndAppConfigInput;
|
|
742
|
+
subBrands?: Record<string, RowndSubBrandConfigInput>;
|
|
743
|
+
}
|
|
744
|
+
interface SuperTokensUserImport {
|
|
745
|
+
externalUserId?: string;
|
|
746
|
+
timeJoined?: number;
|
|
747
|
+
userMetadata: JSONObject;
|
|
748
|
+
loginMethods: ({
|
|
749
|
+
recipeId: "emailpassword";
|
|
750
|
+
email: string;
|
|
751
|
+
passwordHash: string;
|
|
752
|
+
isVerified: boolean;
|
|
753
|
+
tenantIds?: string[];
|
|
754
|
+
} | {
|
|
755
|
+
recipeId: "thirdparty";
|
|
756
|
+
thirdPartyId: string;
|
|
757
|
+
thirdPartyUserId: string;
|
|
758
|
+
email: string;
|
|
759
|
+
isVerified: boolean;
|
|
760
|
+
tenantIds?: string[];
|
|
761
|
+
} | {
|
|
762
|
+
recipeId: "passwordless";
|
|
763
|
+
email?: string;
|
|
764
|
+
phoneNumber?: string;
|
|
765
|
+
isVerified: boolean;
|
|
766
|
+
tenantIds?: string[];
|
|
767
|
+
})[];
|
|
768
|
+
}
|
|
769
|
+
interface IRowndClient {
|
|
770
|
+
validateToken: (token: string) => Promise<{
|
|
771
|
+
user_id: string;
|
|
772
|
+
}>;
|
|
773
|
+
fetchUserInfo: (opts: {
|
|
774
|
+
user_id: string;
|
|
775
|
+
app_id?: string;
|
|
776
|
+
}) => Promise<RowndUser | undefined>;
|
|
777
|
+
}
|
|
778
|
+
type RowndSchemaField = {
|
|
779
|
+
display_name: string;
|
|
780
|
+
type: string;
|
|
781
|
+
user_visible: boolean;
|
|
782
|
+
owned_by?: string;
|
|
783
|
+
read_only?: boolean;
|
|
784
|
+
show_empty?: boolean;
|
|
785
|
+
include_in_session_claims?: boolean;
|
|
786
|
+
session_claim_name?: string;
|
|
787
|
+
};
|
|
788
|
+
type RowndSchema = Record<string, RowndSchemaField>;
|
|
789
|
+
|
|
790
|
+
declare const init: (config: RowndPluginConfig) => SuperTokensPlugin;
|
|
791
|
+
|
|
792
|
+
declare const PLUGIN_ID = "supertokens-plugin-rownd";
|
|
793
|
+
declare const PLUGIN_SDK_VERSION: string[];
|
|
794
|
+
declare const HANDLE_BASE_PATH = "/plugin/rownd";
|
|
795
|
+
declare const PUBLIC_TENANT_ID = "public";
|
|
796
|
+
declare const GUEST_AUTH_METHOD_ID = "guest";
|
|
797
|
+
declare const ANONYMOUS_AUTH_METHOD_ID = "anonymous";
|
|
798
|
+
declare const ROWND_JWT_CLAIMS: {
|
|
799
|
+
readonly AppUserId: "https://auth.rownd.io/app_user_id";
|
|
800
|
+
readonly IsVerifiedUser: "https://auth.rownd.io/is_verified_user";
|
|
801
|
+
readonly IsAnonymous: "https://auth.rownd.io/is_anonymous";
|
|
802
|
+
readonly IssuedOffline: "https://auth.rownd.io/issued_offline";
|
|
803
|
+
readonly JwtType: "https://auth.rownd.io/jwt_type";
|
|
804
|
+
readonly PlatformJwt: "https://auth.rownd.io/platform_jwt";
|
|
805
|
+
readonly AuthLevel: "https://auth.rownd.io/auth_level";
|
|
806
|
+
};
|
|
807
|
+
declare const DEFAULT_ROWND_SCHEMA: RowndSchema;
|
|
808
|
+
|
|
809
|
+
declare const ROWND_PLUGIN_ERROR_MESSAGES: {
|
|
810
|
+
readonly MISSING_AUTHORIZATION_HEADER: "Missing authorization header";
|
|
811
|
+
readonly INVALID_TOKEN: "Invalid token";
|
|
812
|
+
readonly ROWND_USER_NOT_FOUND: "User not found in Rownd";
|
|
813
|
+
};
|
|
814
|
+
type RowndPluginErrorType = keyof typeof ROWND_PLUGIN_ERROR_MESSAGES;
|
|
815
|
+
declare class RowndPluginError extends Error {
|
|
816
|
+
constructor(type: RowndPluginErrorType);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
declare function setRowndClient(client: IRowndClient): void;
|
|
820
|
+
declare function getRowndClient(): IRowndClient;
|
|
821
|
+
|
|
822
|
+
declare const _default: {
|
|
823
|
+
init: (config: RowndPluginConfig) => SuperTokens.SuperTokensPlugin;
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
export { ANONYMOUS_AUTH_METHOD_ID, DEFAULT_ROWND_SCHEMA, GUEST_AUTH_METHOD_ID, HANDLE_BASE_PATH, type IRowndClient, type MigrationResponse, PLUGIN_ID, PLUGIN_SDK_VERSION, PUBLIC_TENANT_ID, ROWND_JWT_CLAIMS, ROWND_PLUGIN_ERROR_MESSAGES, type RowndAppConfigInput, type RowndAuthConfig, type RowndBranding, type RowndCustomContent, type RowndLegal, type RowndPluginConfig, RowndPluginError, type RowndPluginErrorType, type RowndPluginNormalisedConfig, type RowndProfileConfig, type RowndSchema, type RowndSchemaField, type RowndSignInMethod, type RowndSubBrandConfigInput, type RowndTelemetryClient, type RowndTelemetryConfig, type RowndTelemetryEvent, type RowndUser, type RowndUserMetadata, type SuperTokensUserImport, _default as default, getRowndClient, init, setRowndClient };
|