@reachfive/identity-ui 1.25.1 → 1.25.2

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/index.d.ts DELETED
@@ -1,483 +0,0 @@
1
- export * as Core from '@reachfive/identity-core'
2
- import { Client as CoreClient, AuthOptions as CoreAuthOptions, ErrorResponse } from '@reachfive/identity-core'
3
-
4
- import { InitialScreen, ProviderId } from './constants'
5
-
6
- export function createClient(creationConfig: Config): Client
7
-
8
- export interface Client {
9
- core: CoreClient,
10
- showAuth(options: AuthOptions): Promise<void>,
11
- showEmailEditor(options: EmailEditorOptions): Promise<void>,
12
- showPasswordEditor(options: PasswordEditorOptions): Promise<void>,
13
- showPhoneNumberEditor(options: PhoneNumberEditorOptions): Promise<void>,
14
- showPasswordReset(options: PasswordResetOptions): Promise<void>,
15
- showPasswordless(options: PassswordlessOptions): Promise<void>,
16
- showProfileEditor(options: ProfileEditorOptions): Promise<void>,
17
- showSocialAccounts(options: SocialAccountsOptions): Promise<void>,
18
- showSocialLogin(options: SocialLoginOptions): Promise<void>,
19
- showWebAuthnDevices(options: WebAuthnDevicesOptions): Promise<void>,
20
- showMfa(options: MfaOptions): Promise<void>,
21
- showMfaCredentials(options: MfaCredentialsOptions): Promise<void>,
22
- showStepUp(options: StepUpOptions): Promise<void>
23
- }
24
-
25
- export interface Config {
26
- clientId: string,
27
- domain: string,
28
- language?: string,
29
- locale?: string
30
- }
31
-
32
- export interface WidgetInstance {
33
- destroy(): void
34
- }
35
-
36
- interface Container {
37
- /** The DOM element or the `id` of a DOM element in which the widget should be embedded. */
38
- container: HTMLElement | string
39
- }
40
-
41
- interface AccessToken {
42
- /** The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old. */
43
- accessToken: string
44
- }
45
-
46
- interface I18n {
47
- /** Widget labels and error messages to override. Falls back to the default wordings in `en`, `fr`, `es`, `it` and `nl`. */
48
- i18n?: Record<string, string>
49
- }
50
-
51
- interface OnReady {
52
- /**
53
- * Callback function called after the widget has been successfully loaded and rendered inside the container.
54
- * The callback is called with the widget instance.
55
- */
56
- onReady?: (arg: WidgetInstance) => void
57
- }
58
-
59
- interface OnSuccess {
60
- /** Callback function called when the request has failed. */
61
- onSuccess?: () => void
62
- }
63
-
64
- interface OnError {
65
- /** Callback function called after the widget has been successfully loaded and rendered inside the container. The callback is called with the widget instance. */
66
- onError?: (error: ErrorResponse) => void
67
- }
68
-
69
- interface Theme {
70
- /**
71
- * The options to set up to customize the appearance of the widget.
72
- *
73
- * @type Theme
74
- */
75
- theme?: ThemeOptions
76
- }
77
-
78
- export interface ThemeOptions {
79
- /**
80
- * The button and link default color.
81
- * @default "#229955"
82
- */
83
- primaryColor?: string
84
-
85
- /**
86
- * The radius of the social login button and other input (in px).
87
- * @default "3"
88
- */
89
- borderRadius?: string
90
-
91
- /** Social button theming options. */
92
- socialButton?: SocialButtonTheme
93
- }
94
-
95
- export interface SocialButtonTheme {
96
- /** Boolean that specifies if the buttons are inline (horizonally-aligned). */
97
- inline?: boolean
98
- /** Boolean that specifies if the text is visible. */
99
- textVisible?: boolean
100
- /** Specifies the font-weight (such as normal, bold, or 900). */
101
- fontWeight?: string
102
- /** Specifies the font-size. */
103
- fontSize?: string
104
- /** Specifies the line-height. */
105
- lineHeight?: string
106
- /** Specifies the padding for the x axis. (left and right) */
107
- paddingX?: string
108
- /** Specifies the padding for the y axis. (top and bottom) */
109
- paddingY?: string
110
- /** Specifies the border-radius. */
111
- borderRadius?: string
112
- /** Specifies the border-width. */
113
- borderWidth?: string
114
- /** Boolean that specifies if there is a box shadow on the button or not. */
115
- focusBoxShadow?: boolean
116
- }
117
-
118
- /**
119
- * The field's type.
120
- * @enum {('hidden' | 'text' | 'number' | 'email' | 'tel')}
121
- */
122
- export type FieldType = 'hidden' | 'text' | 'number' | 'email' | 'tel'
123
-
124
- /** The field's representation. */
125
- export interface Field {
126
- key: string
127
- label?: string
128
- required?: boolean
129
- type?: FieldType
130
- }
131
-
132
- /**
133
- * The auth type.
134
- * @enum {('magic_link' | 'sms')}
135
- */
136
- export type AuthType = 'magic_link' | 'sms'
137
-
138
- export interface AuthOptions extends Container, I18n, OnReady, Theme {
139
- /**
140
- * Boolean that specifies if the forgot password option is enabled.
141
- *
142
- * If the `allowLogin` and `allowSignup` properties are set to `false`, the forgot password feature is enabled even if `allowForgotPassword` is set to `false`.
143
- *
144
- * @default true
145
- */
146
- allowForgotPassword?: boolean
147
-
148
- /**
149
- * Boolean that specifies whether biometric login is enabled.
150
- *
151
- * @default false
152
- */
153
- allowWebAuthnLogin?: boolean
154
-
155
- /**
156
- * Boolean that specifies whether biometric signup is enabled.
157
- *
158
- * @default false
159
- */
160
- allowWebAuthnSignup?: boolean
161
-
162
- /**
163
- * Boolean that specifies whether login is enabled.
164
- *
165
- * @default true
166
- */
167
- allowLogin?: boolean
168
-
169
- /**
170
- * Boolean that specifies whether signup is enabled.
171
- *
172
- * @default true
173
- */
174
-
175
- allowSignup?: boolean
176
- /**
177
- * Boolean that specifies whether an additional field for the custom identifier is shown.
178
- *
179
- * @default false
180
- */
181
-
182
- allowCustomIdentifier?: boolean
183
-
184
- /** List of authentication options */
185
- auth?: CoreAuthOptions
186
-
187
- /**
188
- * Whether or not to provide the display password in clear text option.
189
- *
190
- * @default false
191
- */
192
- canShowPassword?: boolean
193
-
194
- /**
195
- * The [ISO country](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code useful to format phone numbers.
196
- * Defaults to the predefined country code in your account settings or `FR`.
197
- */
198
- countryCode?: string
199
-
200
- /**
201
- * Whether or not to display a safe error message on password reset, given an invalid email address.
202
- * This mode ensures not to leak email addresses registered to the platform.
203
- *
204
- * @default false
205
- */
206
- displaySafeErrorMessage?: boolean
207
-
208
- /**
209
- * The widget’s initial screen.
210
- *
211
- * - if `allowLogin` is set to `true`, it defaults to `login`.
212
- * - if `allowLogin` is set to `false` and `allowSignup` is set to `true`, it defaults to `signup`.
213
- * - if `allowLogin` is set to `false` and `allowWebAuthnLogin` is set to `true`, it defaults to `login-with-web-authn`.
214
- * - otherwise, defaults to `forgot-password`.
215
- */
216
- initialScreen?: InitialScreen
217
-
218
- /**
219
- * The URL sent in the email to which the user is redirected.
220
- * This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings.
221
- * */
222
- redirectUrl?: string
223
-
224
- /**
225
- * Returned in the `redirectUrl` as a query parameter, this parameter is used as the post-email confirmation URL.
226
- * Important: This parameter should only be used with Hosted Pages.
227
- */
228
- returnToAfterEmailConfirmation?: string
229
-
230
- /**
231
- * Returned in the `redirectUrl` as a query parameter, this parameter is used to redirect users to a specific URL after a password reset.
232
- * Important: This parameter should only be used with Hosted Pages.
233
- */
234
- returnToAfterPasswordReset?: string
235
-
236
- /**
237
- * Whether the signup form fields' labels are displayed on the login view.
238
- *
239
- * @default false
240
- */
241
- showLabels?: boolean
242
-
243
- /**
244
- * Whether the Remember me checkbox is displayed on the login view. Affects user session duration.
245
- *
246
- * The account session duration configured in the ReachFive Console (Settings Security SSO) applies when:
247
- * - The checkbox is hidden from the user
248
- * - The checkbox is visible and selected by the user
249
- *
250
- * If the checkbox is visible and not selected by the user, the default session duration of 1 day applies.
251
- *
252
- * @default false
253
- */
254
- showRememberMe?: boolean
255
-
256
- /**
257
- * List of the signup fields to display in the form.
258
- *
259
- * You can pass a field as an object to override default values :
260
- *
261
- * @example
262
- * {
263
- * "key": "family_name",
264
- * "defaultValue": "Moreau",
265
- * "required": true
266
- * }
267
- */
268
- signupFields?: (Field | string)[]
269
-
270
- /**
271
- * Lists the available social providers. This is an array of strings.
272
- * Tip: If you pass an empty array, social providers will not be displayed.
273
- */
274
- socialProviders?: ProviderId[]
275
-
276
- /** Boolean that specifies whether reCAPTCHA is enabled or not. */
277
- recaptcha_enabled?: boolean
278
-
279
- /** The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup. This must be paired with the appropriate secret key that you received when setting up reCAPTCHA. */
280
- recaptcha_site_key?: string
281
- }
282
-
283
- export interface EmailEditorOptions extends AccessToken, Container, I18n, OnReady, Theme {
284
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings. */
285
- redirectUrl?: string
286
-
287
- /**
288
- * Whether the signup form fields' labels are displayed on the login view.
289
- * @default false
290
- */
291
- showLabels?: boolean
292
- }
293
-
294
- export interface PasswordEditorOptions extends AccessToken, Container, I18n, OnReady, OnSuccess, OnError, Theme {
295
- /**
296
- * Whether the signup form fields' labels are displayed on the login view.
297
- * @default false
298
- */
299
- showLabels?: boolean
300
-
301
- /**
302
- * Ask for the old password before entering a new one.
303
- * @default false
304
- */
305
- promptOldPassword?: boolean
306
-
307
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings. */
308
- redirectUrl?: string
309
- }
310
-
311
- export interface PasswordResetOptions extends Container, OnReady, I18n, Theme {
312
- /** The URL to which the user is redirected after a password reset. */
313
- loginLink?: string
314
-
315
- /**
316
- * Whether or not to provide the display password in clear text option.
317
- * @default false
318
- */
319
- canShowPassword?: boolean
320
-
321
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings. */
322
- redirectUrl?: string
323
- }
324
-
325
- export interface PhoneNumberEditorOptions extends AccessToken, Container, OnReady, I18n, Theme {
326
- /**
327
- * Whether the signup form fields' labels are displayed on the login view.
328
- * @default false
329
- */
330
- showLabels?: boolean
331
-
332
- /**
333
- * The [ISO country](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code useful to format phone numbers.
334
- *
335
- * Defaults to the predefined country code in your account settings or `FR`.
336
- */
337
- countryCode?: string
338
- }
339
-
340
- export interface ProfileEditorOptions extends AccessToken, Container, OnReady, OnSuccess, OnError, I18n, Theme {
341
- /**
342
- * List of the fields to display in the form.
343
- *
344
- * **Important:**
345
- *
346
- * The following fields can not be changed with this widget:
347
- * - `password`
348
- * - `password_confirmation`
349
- *
350
- * It is not possible to update the primary identifier submitted at registration (email or phone number). When the primary identifier is the email address (SMS feature disabled), users can only enter a phone number and update without limit.
351
- */
352
- fields?: (Field | string)[]
353
-
354
- /**
355
- * Whether the signup form fields' labels are displayed on the login view.
356
- * @default false
357
- */
358
- showLabels?: boolean
359
-
360
- /**
361
- * The [ISO country](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code useful to format phone numbers.
362
- *
363
- * Defaults to the predefined country code in your account settings or `FR`.
364
- */
365
- countryCode?: string
366
-
367
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the `Allowed Callback URLs` field of your ReachFive client settings. */
368
- redirectUrl?: string
369
- }
370
-
371
- export interface SocialAccountsOptions extends AccessToken, Container, I18n, OnReady, Theme {
372
- /**
373
- * Lists the available social providers. This is an array of strings.
374
- *
375
- * Tip: If you pass an empty array, social providers will not be displayed.
376
- * */
377
- providers?: ProviderId[]
378
-
379
- /** List of authentication options */
380
- auth?: CoreAuthOptions
381
- }
382
-
383
- export interface SocialLoginOptions extends Container, I18n, OnReady, Theme {
384
- /**
385
- * Lists the available social providers. This is an array of strings.
386
- *
387
- * Tip: If you pass an empty array, social providers will not be displayed.
388
- * */
389
- socialProviders?: ProviderId[]
390
-
391
- /** List of authentication options */
392
- auth?: CoreAuthOptions
393
-
394
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings. */
395
- redirectUrl?: string
396
- }
397
-
398
- export interface PassswordlessOptions extends Container, I18n, OnReady, OnSuccess, OnError, Theme {
399
- /**
400
- * The passwordless auth type (`magic_link` or `sms`).
401
- * @default "magic_link"
402
- */
403
- authType?: AuthType
404
-
405
- /**
406
- * Show the social login buttons.
407
- * @default false
408
- */
409
- showSocialLogins?: boolean
410
-
411
- /**
412
- * Lists the available social providers. This is an array of strings.
413
- *
414
- * Tip: If you pass an empty array, social providers will not be displayed.
415
- */
416
- socialProviders?: ProviderId[]
417
-
418
- /**
419
- * Show the introduction text.
420
- * @default true
421
- */
422
- showIntro?: boolean
423
-
424
- /**
425
- * The [ISO country](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code useful to format phone numbers.
426
- *
427
- * Defaults to the predefined country code in your account settings or `FR`.
428
- */
429
- countryCode?: string
430
-
431
- /** List of authentication options */
432
- auth?: CoreAuthOptions
433
-
434
- /** The URL sent in the email to which the user is redirected. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings. */
435
- redirectUrl?: string
436
-
437
- /** Boolean that specifies whether reCAPTCHA is enabled or not. */
438
- recaptcha_enabled?: boolean
439
-
440
- /** The SITE key that comes from your [reCAPTCHA](https://www.google.com/recaptcha/admin/create) setup. This must be paired with the appropriate secret key that you received when setting up reCAPTCHA. */
441
- recaptcha_site_key?: string
442
- }
443
-
444
- export interface WebAuthnDevicesOptions extends AccessToken, Container, I18n, OnReady, Theme {}
445
-
446
- export interface MfaOptions extends AccessToken, Container, I18n, OnReady, Theme {
447
- /**
448
- * Show the introduction text.
449
- * @default true
450
- */
451
- showIntro?: boolean
452
-
453
- /**
454
- * Boolean to enable (`true`) or disable (`false`) whether the option to remove MFA credentials are displayed.
455
- * @default true
456
- */
457
- showRemoveMfaCredentials?: boolean
458
-
459
- /**
460
- * Boolean to enable (`true`) or disable (`false`) whether the option to remove MFA credentials are displayed.
461
- * @default false
462
- */
463
- requireMfaRegistration?: boolean
464
- }
465
-
466
- export interface MfaCredentialsOptions extends AccessToken, Container, I18n, OnReady, Theme {}
467
-
468
- export interface StepUpOptions extends AccessToken, Container, I18n, OnReady, Theme {
469
- /** List of authentication options */
470
- auth?: CoreAuthOptions
471
-
472
- /**
473
- * Show the introduction text.
474
- * @default true
475
- */
476
- showIntro?: boolean
477
-
478
- /**
479
- * Show the stepup button. Unnecessary for console use
480
- * @default true
481
- */
482
- showStepUpStart?: boolean
483
- }