@@ -201,6 +201,68 @@ private randomString = (): string => {
201201}
202202```
203203
204+ ### Approval with WebAuthn
205+ ``` js
206+ onApprovalWebAuthn = async (username: string, approvalData: { [key: string]: string }): Promise < void > => {
207+ try {
208+ const result = await TSAuthenticationSDKModule .approvalWebAuthn (username, approvalData, []);
209+ console .log (" Approval result: " , result);
210+ } catch (error: any) {
211+ this .setState ({ errorMessage: ` ${ error} ` });
212+ }
213+ }
214+ ```
215+
216+ ### Approval with WebAuthn with Authentication Data
217+ ``` js
218+ onApprovalWebAuthnWithData = async (rawAuthenticationData: TSWebAuthnAuthenticationData): Promise < void > => {
219+ try {
220+ const result = await TSAuthenticationSDKModule .approvalWebAuthnWithData (rawAuthenticationData, []);
221+ console .log (" Approval result: " , result);
222+ } catch (error: any) {
223+ this .setState ({ errorMessage: ` ${ error} ` });
224+ }
225+ }
226+ ```
227+
228+ ### Approval with WebAuthn with Native Biometrics
229+
230+ ``` js
231+ onApprovalNativeBiometrics = async (username : string ) => {
232+ try {
233+ const result = await TSAuthenticationSDKModule .approvalNativeBiometrics (username, challenge);
234+ console .log (" Approval result: " , result);
235+ } catch (error: any) {
236+ this .setState ({ errorMessage: ` ${ error} ` });
237+ }
238+ }
239+ ```
240+
241+ ### Register PIN Code
242+ ``` js
243+ onRegisterPINCode = async (username: string, pinCode: string): Promise < void > => {
244+ try {
245+ const result = await TSAuthenticationSDKModule .registerPinCode (username, pinCode);
246+ // use result.contextIdentifier to commit the registration
247+ await TSAuthenticationSDKModule .commitPinRegistration (result .contextIdentifier );
248+ } catch (error) {
249+ console .error (` Error registering PIN code: ${ error} ` );
250+ }
251+ }
252+ ```
253+
254+ ### Authenticate with PIN Code
255+ ``` js
256+ authenticatePinCode = async (username: string, pinCode: string): Promise < void > => {
257+ try {
258+ const result = await TSAuthenticationSDKModule .authenticatePinCode (username, pinCode);
259+ // use the result string to complete PIN authentication in your backend.
260+ } catch (error) {
261+ console .error (` Error authenticating with PIN code: ${ error} ` );
262+ }
263+ }
264+ ```
265+
204266### Information about the device
205267
206268#### Get Device Info
0 commit comments