@supertokens-plugins/rownd-nodejs 0.2.1 → 0.3.0-beta.1

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