@transmitsecurity/platform-web-sdk 1.15.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +479 -0
  2. package/README.md +72 -0
  3. package/VITE_CONFIG.md +107 -0
  4. package/build/drs-entry.d.ts +20 -0
  5. package/build/drs-entry.js +19 -0
  6. package/build/drs-only.d.ts +22 -0
  7. package/build/drs-only.js +25 -0
  8. package/build/drs.d.ts +13 -0
  9. package/build/drs.js +45 -0
  10. package/build/ido-entry.d.ts +17 -0
  11. package/build/ido-entry.js +19 -0
  12. package/build/ido.d.ts +8 -0
  13. package/build/ido.js +27 -0
  14. package/build/idv-entry.d.ts +17 -0
  15. package/build/idv-entry.js +19 -0
  16. package/build/idv.d.ts +8 -0
  17. package/build/idv.js +27 -0
  18. package/build/initialize-only.d.ts +7 -0
  19. package/build/initialize-only.js +40 -0
  20. package/build/initialize.d.ts +1 -0
  21. package/build/initialize.js +2 -0
  22. package/build/mainExport.d.ts +16 -0
  23. package/build/mainExport.js +43 -0
  24. package/build/sdk-factory.d.ts +109 -0
  25. package/build/sdk-factory.js +108 -0
  26. package/build/shared-state.d.ts +4 -0
  27. package/build/shared-state.js +32 -0
  28. package/build/webauthn-entry.d.ts +19 -0
  29. package/build/webauthn-entry.js +19 -0
  30. package/build/webauthn.d.ts +12 -0
  31. package/build/webauthn.js +44 -0
  32. package/bundler-config.json +15 -0
  33. package/dist/docs/.nojekyll +1 -0
  34. package/dist/docs/README.md +72 -0
  35. package/dist/docs/enums/ErrorCode.md +113 -0
  36. package/dist/docs/interfaces/ActionEventOptions.md +44 -0
  37. package/dist/docs/interfaces/ActionResponse.md +9 -0
  38. package/dist/docs/interfaces/AuthenticationAutofillActivateHandlers.md +61 -0
  39. package/dist/docs/interfaces/AutofillHandlers.md +50 -0
  40. package/dist/docs/interfaces/CrossDeviceController.md +27 -0
  41. package/dist/docs/interfaces/SdkError.md +28 -0
  42. package/dist/docs/interfaces/WebauthnApis.md +73 -0
  43. package/dist/docs/interfaces/WebauthnAuthenticationFlows.md +52 -0
  44. package/dist/docs/interfaces/WebauthnCrossDeviceFlows.md +107 -0
  45. package/dist/docs/interfaces/WebauthnCrossDeviceRegistrationOptions.md +23 -0
  46. package/dist/docs/interfaces/WebauthnRegistrationOptions.md +55 -0
  47. package/dist/docs/interfaces/initConfigParams.md +7 -0
  48. package/dist/docs/modules/drs.md +92 -0
  49. package/dist/docs/modules/idv.md +106 -0
  50. package/dist/docs/modules/webauthn.md +197 -0
  51. package/dist/docs/modules.md +146 -0
  52. package/dist/drs.cjs +1 -0
  53. package/dist/drs.d.ts +241 -0
  54. package/dist/drs.js +1 -0
  55. package/dist/ido.cjs +1 -0
  56. package/dist/ido.d.ts +8 -0
  57. package/dist/ido.js +1 -0
  58. package/dist/idv.cjs +1 -0
  59. package/dist/idv.d.ts +68 -0
  60. package/dist/idv.js +1 -0
  61. package/dist/index.cjs +1 -0
  62. package/dist/index.esm.js +1 -0
  63. package/dist/index.umd.js +1 -0
  64. package/dist/ts-platform-websdk.js +1 -0
  65. package/dist/web-sdk-drs+idv+webauthn+ido.js +1 -0
  66. package/dist/web-sdk.d.ts +1737 -0
  67. package/dist/webauthn.cjs +1 -0
  68. package/dist/webauthn.d.ts +461 -0
  69. package/dist/webauthn.js +1 -0
  70. package/package.json +98 -0
  71. package/scripts/make-semver-aliases.sh +11 -0
  72. package/scripts/upload-dist.sh +6 -0
  73. package/src/mainExport.ts +75 -0
  74. package/src/tsconfig.json +14 -0
@@ -0,0 +1,107 @@
1
+ # Interface: WebauthnCrossDeviceFlows
2
+
3
+ ## Properties
4
+
5
+ ### init
6
+
7
+ • **init**: `Object`
8
+
9
+ Initializes a cross device flow, such as when users request to login to a desktop using their mobile device. Once invoked, the SDK will start listening for events occurring on the other device,
10
+ and calls your handlers when a state change is detected.
11
+ These methods return a promise that resolves to a [CrossDeviceController](CrossDeviceController.md) object, which allows you to stop listening to events and includes the cross-device ticket ID which is used when attaching another device to the flow.
12
+
13
+ #### Type declaration
14
+
15
+ | Name | Type |
16
+ | :------ | :------ |
17
+ | `registration` | (`params`: { `crossDeviceTicketId`: `string` ; `handlers`: `CrossDeviceRegistrationHandlers` }) => `Promise`<[`CrossDeviceController`](CrossDeviceController.md)\> |
18
+ | `authentication` | (`params`: { `username?`: `string` ; `handlers`: `CrossDeviceAuthenticationHandlers` }) => `Promise`<[`CrossDeviceController`](CrossDeviceController.md)\> |
19
+ | `approval` | (`params`: { `username`: `string` ; `approvalData`: `Record`<`string`, `string`\> ; `handlers`: `CrossDeviceAuthenticationHandlers` }) => `Promise`<[`CrossDeviceController`](CrossDeviceController.md)\> |
20
+
21
+ ___
22
+
23
+ ### authenticate
24
+
25
+ • **authenticate**: `Object`
26
+
27
+ #### Type declaration
28
+
29
+ | Name | Type |
30
+ | :------ | :------ |
31
+ | `modal` | (`crossDeviceTicketId`: `string`) => `Promise`<`string`\> |
32
+
33
+ ___
34
+
35
+ ### approve
36
+
37
+ • **approve**: `Object`
38
+
39
+ #### Type declaration
40
+
41
+ | Name | Type |
42
+ | :------ | :------ |
43
+ | `modal` | (`crossDeviceTicketId`: `string`) => `Promise`<`string`\> |
44
+
45
+ ___
46
+
47
+ ### register
48
+
49
+ • **register**: (`crossDeviceTicketId`: `string`, `options?`: [`WebauthnCrossDeviceRegistrationOptions`](WebauthnCrossDeviceRegistrationOptions.md)) => `Promise`<`string`\>
50
+
51
+ #### Type declaration
52
+
53
+ ▸ (`crossDeviceTicketId`, `options?`): `Promise`<`string`\>
54
+
55
+ Invokes a WebAuthn credential registration for the user used in the cross device session init, including prompting the user for biometrics.
56
+ If registration is completed successfully, this call will return a promise that resolves to the credential result, which is an object encoded as a base64 string. This encoded result should then be passed to the relevant backend registration endpoint to complete the registration for either a [logged-in user](/openapi/user/backend-webauthn/#operation/webauthn-registration) or [logged-out user](/openapi/user/backend-webauthn/#operation/webauthn-registration-external).
57
+ If registration fails, an SdkError will be thrown.
58
+ If the backend registration call was successful, CrossDeviceRegistrationHandlers.onCredentialRegister will be called.
59
+
60
+ **`Throws`**
61
+
62
+ [NotInitialized](../enums/ErrorCode.md#notinitialized)
63
+
64
+ **`Throws`**
65
+
66
+ [RegistrationFailed](../enums/ErrorCode.md#registrationfailed)
67
+
68
+ **`Throws`**
69
+
70
+ [RegistrationCanceled](../enums/ErrorCode.md#registrationcanceled)
71
+
72
+ ##### Parameters
73
+
74
+ | Name | Type | Description |
75
+ | :------ | :------ | :------ |
76
+ | `crossDeviceTicketId` | `string` | Ticket ID of the cross-device flow. retrieved from the [CrossDeviceController](CrossDeviceController.md) object. |
77
+ | `options?` | [`WebauthnCrossDeviceRegistrationOptions`](WebauthnCrossDeviceRegistrationOptions.md) | Additional configuration for registration flow |
78
+
79
+ ##### Returns
80
+
81
+ `Promise`<`string`\>
82
+
83
+ ___
84
+
85
+ ### attachDevice
86
+
87
+ • **attachDevice**: (`crossDeviceTicketId`: `string`) => `Promise`<`AttachDeviceResult`\>
88
+
89
+ #### Type declaration
90
+
91
+ ▸ (`crossDeviceTicketId`): `Promise`<`AttachDeviceResult`\>
92
+
93
+ Indicates when a session is accepted on another device in cross-device flows.
94
+
95
+ If successful,CrossDeviceRegistrationHandlers.onDeviceAttach will be called in registration flow and CrossDeviceAuthenticationHandlers.onDeviceAttach for authentication.
96
+
97
+ ##### Parameters
98
+
99
+ | Name | Type | Description |
100
+ | :------ | :------ | :------ |
101
+ | `crossDeviceTicketId` | `string` | Ticket ID of the cross-device flow. retrieved from the [CrossDeviceController](CrossDeviceController.md) object. |
102
+
103
+ ##### Returns
104
+
105
+ `Promise`<`AttachDeviceResult`\>
106
+
107
+ AttachDeviceResult AttachDeviceResult. Object containing the ticket status, creation timestamp, and approval data (if passed in the init.authentication() call)
@@ -0,0 +1,23 @@
1
+ # Interface: WebauthnCrossDeviceRegistrationOptions
2
+
3
+ ## Hierarchy
4
+
5
+ - **`WebauthnCrossDeviceRegistrationOptions`**
6
+
7
+ ↳ [`WebauthnRegistrationOptions`](WebauthnRegistrationOptions.md)
8
+
9
+ ## Properties
10
+
11
+ ### allowCrossPlatformAuthenticators
12
+
13
+ • `Optional` **allowCrossPlatformAuthenticators**: `boolean`
14
+
15
+ Allow registration using cross-platform authenticators, such as a USB security key or a different device. If enabled, cross-device authentication flows can be performed using the native browser experience (via QR code). default: True
16
+
17
+ ___
18
+
19
+ ### registerAsDiscoverable
20
+
21
+ • `Optional` **registerAsDiscoverable**: `boolean`
22
+
23
+ Must be set to true to register credentials as passkeys when supported (except for Apple devices, which always register credentials as passkeys). default: True
@@ -0,0 +1,55 @@
1
+ # Interface: WebauthnRegistrationOptions
2
+
3
+ ## Hierarchy
4
+
5
+ - [`WebauthnCrossDeviceRegistrationOptions`](WebauthnCrossDeviceRegistrationOptions.md)
6
+
7
+ ↳ **`WebauthnRegistrationOptions`**
8
+
9
+ ## Properties
10
+
11
+ ### allowCrossPlatformAuthenticators
12
+
13
+ • `Optional` **allowCrossPlatformAuthenticators**: `boolean`
14
+
15
+ Allow registration using cross-platform authenticators, such as a USB security key or a different device. If enabled, cross-device authentication flows can be performed using the native browser experience (via QR code). default: True
16
+
17
+ #### Inherited from
18
+
19
+ [WebauthnCrossDeviceRegistrationOptions](WebauthnCrossDeviceRegistrationOptions.md).[allowCrossPlatformAuthenticators](WebauthnCrossDeviceRegistrationOptions.md#allowcrossplatformauthenticators)
20
+
21
+ ___
22
+
23
+ ### registerAsDiscoverable
24
+
25
+ • `Optional` **registerAsDiscoverable**: `boolean`
26
+
27
+ Must be set to true to register credentials as passkeys when supported (except for Apple devices, which always register credentials as passkeys). default: True
28
+
29
+ #### Inherited from
30
+
31
+ [WebauthnCrossDeviceRegistrationOptions](WebauthnCrossDeviceRegistrationOptions.md).[registerAsDiscoverable](WebauthnCrossDeviceRegistrationOptions.md#registerasdiscoverable)
32
+
33
+ ___
34
+
35
+ ### displayName
36
+
37
+ • `Optional` **displayName**: `string`
38
+
39
+ Human-palatable name for the user account, only for display (max 64 characters). If not set, the username parameter will also act as the display name
40
+
41
+ ___
42
+
43
+ ### timeout
44
+
45
+ • `Optional` **timeout**: `number`
46
+
47
+ The timeout in seconds for the registration process. If the timeout is reached, the registration process will be aborted with error [RegistrationAbortedTimeout](../enums/ErrorCode.md#registrationabortedtimeout).
48
+
49
+ ___
50
+
51
+ ### limitSingleCredentialToDevice
52
+
53
+ • `Optional` **limitSingleCredentialToDevice**: `boolean`
54
+
55
+ Set to True in order to limit the creation of multiple credentials for the same account on a single authenticator. default: False
@@ -0,0 +1,7 @@
1
+ # Interface: initConfigParams
2
+
3
+ ## Properties
4
+
5
+ ### clientId
6
+
7
+ • **clientId**: `string`
@@ -0,0 +1,92 @@
1
+ # Namespace: drs
2
+
3
+ ## Type Aliases
4
+
5
+ ### ActionEventOptions
6
+
7
+ Ƭ **ActionEventOptions**: [`ActionEventOptions`](../interfaces/ActionEventOptions.md)
8
+
9
+ ___
10
+
11
+ ### ActionResponse
12
+
13
+ Ƭ **ActionResponse**: [`ActionResponse`](../interfaces/ActionResponse.md)
14
+
15
+ ## Variables
16
+
17
+ ### \_\_internal
18
+
19
+ • `Const` **\_\_internal**: typeof `__internal`
20
+
21
+ ## Functions
22
+
23
+ ### clearUser
24
+
25
+ ▸ **clearUser**(`options?`): `Promise`<`boolean`\>
26
+
27
+ Clears the user context for all subsequent events in the browser session
28
+
29
+ #### Parameters
30
+
31
+ | Name | Type | Description |
32
+ | :------ | :------ | :------ |
33
+ | `options?` | `Object` | Reserved for future use |
34
+
35
+ #### Returns
36
+
37
+ `Promise`<`boolean`\>
38
+
39
+ Indicates if the call succeeded
40
+
41
+ ___
42
+
43
+ ### getSessionToken
44
+
45
+ ▸ **getSessionToken**(): `Promise`<`any`\>
46
+
47
+ #### Returns
48
+
49
+ `Promise`<`any`\>
50
+
51
+ ___
52
+
53
+ ### setAuthenticatedUser
54
+
55
+ ▸ **setAuthenticatedUser**(`userId`, `options?`): `Promise`<`boolean`\>
56
+
57
+ Sets the user context for all subsequent events in the browser session (or until the user is explicitly cleared)
58
+ It should be set only after you've fully authenticated the user (including, for example, any 2FA that was required)
59
+
60
+ #### Parameters
61
+
62
+ | Name | Type | Description |
63
+ | :------ | :------ | :------ |
64
+ | `userId` | `string` | Opaque identifier of the user in your system |
65
+ | `options?` | `Object` | Reserved for future use |
66
+
67
+ #### Returns
68
+
69
+ `Promise`<`boolean`\>
70
+
71
+ Indicates if the call succeeded
72
+
73
+ ___
74
+
75
+ ### triggerActionEvent
76
+
77
+ ▸ **triggerActionEvent**(`actionType`, `options?`): `Promise`<[`ActionResponse`](../interfaces/ActionResponse.md)\>
78
+
79
+ Reports a user action event to the SDK
80
+
81
+ #### Parameters
82
+
83
+ | Name | Type | Description |
84
+ | :------ | :------ | :------ |
85
+ | `actionType` | `string` | Type of user action event that was predefined in the Transmit Security server |
86
+ | `options?` | [`ActionEventOptions`](../interfaces/ActionEventOptions.md) | - |
87
+
88
+ #### Returns
89
+
90
+ `Promise`<[`ActionResponse`](../interfaces/ActionResponse.md)\>
91
+
92
+ Indicates if the call succeeded
@@ -0,0 +1,106 @@
1
+ # Namespace: idv
2
+
3
+ ## Functions
4
+
5
+ ### recapture
6
+
7
+ ▸ **recapture**(): `Promise`<`boolean`\>
8
+
9
+ Recaptures the required images in case the `recapture` status is returned. For example, this may occur in case some data
10
+ couldn't be extracted due to poor image quality.
11
+
12
+ **`Function`**
13
+
14
+ recapture
15
+
16
+ **`Memberof`**
17
+
18
+ module:core
19
+
20
+ **`Example`**
21
+
22
+ ```ts
23
+ const showLoader = true;
24
+ tsPlatform.idv.recapture().then((success) => {
25
+ showLoader = false;
26
+ if (success) {
27
+ console.log('Recapture started');
28
+ } else {
29
+ console.log('Recapture not started');
30
+ }
31
+ });
32
+ ```
33
+
34
+ #### Returns
35
+
36
+ `Promise`<`boolean`\>
37
+
38
+ Indicates if the session was started successfully
39
+
40
+ ___
41
+
42
+ ### restart
43
+
44
+ ▸ **restart**(): `Promise`<`boolean`\>
45
+
46
+ deprecated use module:tsPlatform.idv.recapture|recapture instead
47
+ TODO: [VER-3126](https://transmitsecurity.atlassian.net/browse/VER-3126)
48
+
49
+ #### Returns
50
+
51
+ `Promise`<`boolean`\>
52
+
53
+ ___
54
+
55
+ ### start
56
+
57
+ ▸ **start**(`startToken?`): `Promise`<`boolean`\>
58
+
59
+ Starts a verification session that was created in the backend (via the [Verification API](/openapi/verify/verifications/#operation/createSession)).
60
+ This will start the verification process for the user and guides them through the entire identity verification flow
61
+ using the Transmit identity verification experience, which includes capturing the required images and submitting them for processing.
62
+
63
+ **`Function`**
64
+
65
+ start
66
+
67
+ **`Memberof`**
68
+
69
+ module:core
70
+
71
+ **`Example`**
72
+
73
+ ```ts
74
+ const showLoader = true;
75
+ const startToken = '123456'; // start_token returned by the backend upon session creation
76
+ tsPlatform.idv.start(startToken).then((started) => {
77
+ showLoader = false;
78
+ if (started) {
79
+ console.log('Session started');
80
+ } else {
81
+ console.log('Session not started');
82
+ }
83
+ });
84
+ ```
85
+
86
+ #### Parameters
87
+
88
+ | Name | Type | Description |
89
+ | :------ | :------ | :------ |
90
+ | `startToken?` | `string` | The start_token returned by the backend when the session was created, used to bind the session to the device |
91
+
92
+ #### Returns
93
+
94
+ `Promise`<`boolean`\>
95
+
96
+ Indicates if the session was started successfully
97
+
98
+ ___
99
+
100
+ ### version
101
+
102
+ ▸ **version**(): `string`
103
+
104
+ #### Returns
105
+
106
+ `string`
@@ -0,0 +1,197 @@
1
+ # Namespace: webauthn
2
+
3
+ ## Type Aliases
4
+
5
+ ### ApiCrossDeviceStatusResponse
6
+
7
+ Ƭ **ApiCrossDeviceStatusResponse**: `ApiCrossDeviceStatusResponse`
8
+
9
+ ___
10
+
11
+ ### AttachDeviceResult
12
+
13
+ Ƭ **AttachDeviceResult**: `AttachDeviceResult`
14
+
15
+ ___
16
+
17
+ ### AuthenticationAutofillActivateHandlers
18
+
19
+ Ƭ **AuthenticationAutofillActivateHandlers**: [`AuthenticationAutofillActivateHandlers`](../interfaces/AuthenticationAutofillActivateHandlers.md)
20
+
21
+ ___
22
+
23
+ ### AutofillHandlers
24
+
25
+ Ƭ **AutofillHandlers**: [`AutofillHandlers`](../interfaces/AutofillHandlers.md)
26
+
27
+ ___
28
+
29
+ ### CrossDeviceAuthenticationHandlers
30
+
31
+ Ƭ **CrossDeviceAuthenticationHandlers**: `CrossDeviceAuthenticationHandlers`
32
+
33
+ ___
34
+
35
+ ### CrossDeviceController
36
+
37
+ Ƭ **CrossDeviceController**: [`CrossDeviceController`](../interfaces/CrossDeviceController.md)
38
+
39
+ ___
40
+
41
+ ### CrossDeviceRegistrationHandlers
42
+
43
+ Ƭ **CrossDeviceRegistrationHandlers**: `CrossDeviceRegistrationHandlers`
44
+
45
+ ___
46
+
47
+ ### SdkError
48
+
49
+ Ƭ **SdkError**: [`SdkError`](../interfaces/SdkError.md)
50
+
51
+ ___
52
+
53
+ ### WebauthnApis
54
+
55
+ Ƭ **WebauthnApis**: [`WebauthnApis`](../interfaces/WebauthnApis.md)
56
+
57
+ ___
58
+
59
+ ### WebauthnApprovalFlows
60
+
61
+ Ƭ **WebauthnApprovalFlows**: `WebauthnApprovalFlows`
62
+
63
+ ___
64
+
65
+ ### WebauthnAuthenticationFlows
66
+
67
+ Ƭ **WebauthnAuthenticationFlows**: [`WebauthnAuthenticationFlows`](../interfaces/WebauthnAuthenticationFlows.md)
68
+
69
+ ___
70
+
71
+ ### WebauthnAuthenticationOptions
72
+
73
+ Ƭ **WebauthnAuthenticationOptions**: `WebauthnAuthenticationOptions`
74
+
75
+ ___
76
+
77
+ ### WebauthnCrossDeviceFlows
78
+
79
+ Ƭ **WebauthnCrossDeviceFlows**: [`WebauthnCrossDeviceFlows`](../interfaces/WebauthnCrossDeviceFlows.md)
80
+
81
+ ___
82
+
83
+ ### WebauthnCrossDeviceRegistrationOptions
84
+
85
+ Ƭ **WebauthnCrossDeviceRegistrationOptions**: [`WebauthnCrossDeviceRegistrationOptions`](../interfaces/WebauthnCrossDeviceRegistrationOptions.md)
86
+
87
+ ___
88
+
89
+ ### WebauthnCrossDeviceStatus
90
+
91
+ Ƭ **WebauthnCrossDeviceStatus**: `WebauthnCrossDeviceStatus`
92
+
93
+ ___
94
+
95
+ ### WebauthnRegistrationOptions
96
+
97
+ Ƭ **WebauthnRegistrationOptions**: [`WebauthnRegistrationOptions`](../interfaces/WebauthnRegistrationOptions.md)
98
+
99
+ ## Variables
100
+
101
+ ### WebauthnCrossDeviceStatus
102
+
103
+ • **WebauthnCrossDeviceStatus**: typeof `WebauthnCrossDeviceStatus`
104
+
105
+ ___
106
+
107
+ ### approve
108
+
109
+ • `Const` **approve**: typeof `approve`
110
+
111
+ ___
112
+
113
+ ### authenticate
114
+
115
+ • `Const` **authenticate**: typeof [`authenticate`](../modules.md#authenticate)
116
+
117
+ ___
118
+
119
+ ### crossDevice
120
+
121
+ • `Const` **crossDevice**: typeof [`crossDevice`](../modules.md#crossdevice)
122
+
123
+ ## Functions
124
+
125
+ ### getDefaultPaths
126
+
127
+ ▸ **getDefaultPaths**(): [`WebauthnApis`](../interfaces/WebauthnApis.md)
128
+
129
+ Returns the default API paths for webauthn
130
+
131
+ #### Returns
132
+
133
+ [`WebauthnApis`](../interfaces/WebauthnApis.md)
134
+
135
+ ___
136
+
137
+ ### isAutofillSupported
138
+
139
+ ▸ **isAutofillSupported**(): `Promise`<`boolean`\>
140
+
141
+ Indicates whether this browser supports Passkey Autofill
142
+
143
+ #### Returns
144
+
145
+ `Promise`<`boolean`\>
146
+
147
+ ___
148
+
149
+ ### isPlatformAuthenticatorSupported
150
+
151
+ ▸ **isPlatformAuthenticatorSupported**(): `Promise`<`boolean`\>
152
+
153
+ Indicates whether this browser supports WebAuthn, and has a platform authenticator
154
+
155
+ #### Returns
156
+
157
+ `Promise`<`boolean`\>
158
+
159
+ ___
160
+
161
+ ### register
162
+
163
+ ▸ **register**(`username`, `options?`): `Promise`<`string`\>
164
+
165
+ Invokes a WebAuthn credential registration for the specified user, including prompting the user for biometrics.
166
+ If registration is completed successfully, this call will return a promise that resolves to the credential result, which is an object encoded as a base64 string. This encoded result should then be passed to the relevant backend registration endpoint to complete the registration for either a [logged-in user](/openapi/user/backend-webauthn/#operation/webauthn-registration) or [logged-out user](/openapi/user/backend-webauthn/#operation/webauthn-registration-external).
167
+
168
+ If registration fails, an SdkError will be thrown.
169
+
170
+ **`Throws`**
171
+
172
+ [NotInitialized](../enums/ErrorCode.md#notinitialized)
173
+
174
+ **`Throws`**
175
+
176
+ [RegistrationFailed](../enums/ErrorCode.md#registrationfailed)
177
+
178
+ **`Throws`**
179
+
180
+ [RegistrationCanceled](../enums/ErrorCode.md#registrationcanceled)
181
+
182
+ #### Parameters
183
+
184
+ | Name | Type | Description |
185
+ | :------ | :------ | :------ |
186
+ | `username` | `string` | WebAuthn username to register |
187
+ | `options?` | [`WebauthnRegistrationOptions`](../interfaces/WebauthnRegistrationOptions.md) | Additional configuration for registration flow |
188
+
189
+ #### Returns
190
+
191
+ `Promise`<`string`\>
192
+
193
+ ## References
194
+
195
+ ### ErrorCode
196
+
197
+ Re-exports [ErrorCode](../enums/ErrorCode.md)