Skip to content

Commit be93720

Browse files
henrycheanickj
authored andcommitted
fix: styling & small bugs
1 parent d2f7ac7 commit be93720

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+351
-869
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ This repository holds code example for IDVerse's [IDV Platform](https://idvplatf
44

55
The SDK documentation is available at [idvplatform.docs.idverse.com/docs/getting-started](https://idvplatform.docs.idverse.com/docs/getting-started).
66

7+
## Quick Start
8+
9+
- Make sure you have [Node.js](https://nodejs.org/) installed
10+
- Download the built SDK from your Tenant session
11+
- Extract the `sdk-build-******.zip` and copy `idverse-sdk-browser` folder to the `sdk-integration-examples` folder
12+
- For each app you will need to run `npm install` to get all the dependencies then update the code below with parameters with those from your Tenant session:
13+
14+
```jsx
15+
<idverse-sdk-ui
16+
session-url="YOUR_SESSION_URL"
17+
session-token="YOUR_SESSION_TOKEN"
18+
session-build-id="YOUR_SESSION_BUILD_ID"
19+
></idverse-sdk-ui>
20+
```
21+
22+
- Run the app with `npm run host` (your app will be available on the local network for testing with other devices as well)
23+
724
## Example Apps
825

926
- [IDKit Core Web SDK using Angular](./sdk-integration-examples/web-sdk/angular)

sdk-integration-examples/web-sdk/angular/face-scan/angular.json

+3
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
}
9090
}
9191
}
92+
},
93+
"cli": {
94+
"analytics": false
9295
}
9396
}

sdk-integration-examples/web-sdk/angular/face-scan/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
7+
"host": "ng serve --host 0.0.0.0 --port 4200 --ssl true",
78
"build": "ng build",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test"
@@ -18,8 +19,8 @@
1819
"@angular/platform-browser": "^18.2.0",
1920
"@angular/platform-browser-dynamic": "^18.2.0",
2021
"@angular/router": "^18.2.0",
21-
"@idverse/idverse-sdk-browser": "file:../../..",
22-
"@idverse/idverse-sdk-ui": "file:../../../ui",
22+
"@idverse/idverse-sdk-browser": "file:../../../idverse-sdk-browser",
23+
"@idverse/idverse-sdk-ui": "file:../../../idverse-sdk-browser/ui",
2324
"rxjs": "~7.8.0",
2425
"tslib": "^2.3.0",
2526
"zone.js": "~0.14.10"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div id="root">
22
<div>
33
<a href="https://idverse.com" target="_blank">
4-
<img src="/logo.svg" className="logo" alt="IDVerse logo" />
4+
<img src="/logo.svg" class="logo" alt="IDVerse logo" />
55
</a>
66
</div>
77
<h1>Simple Face Scan with Angluar</h1>
@@ -11,19 +11,26 @@ <h1>Simple Face Scan with Angluar</h1>
1111
<div class="card" *ngIf="!loading">
1212
<button (click)="onhandleStart()">Start Face Scan</button>
1313
</div>
14+
<div class="card" *ngIf="resultData === 1">
15+
<button (click)="onClose()">Close</button>
16+
</div>
1417
<idv-modal *ngIf="errorText" warning visible heading="An error occurred.">
1518
<p>{{ errorText }}</p>
1619
<div>
17-
<idv-button (click)="onClearError()" label="Close" variant="primary outline"></idv-button>
20+
<idv-button
21+
(click)="onClearError()"
22+
label="Close"
23+
variant="primary outline"
24+
></idv-button>
1825
</div>
1926
</idv-modal>
20-
<app-details *ngIf="resultData" [details]="resultData" (onClose)="onClose()"
21-
(onTryAgain)="onTryAgain()"></app-details>
22-
23-
<idverse-sdk-ui session-url="https://sessions.au.idkit.com/v1" session-token="a0dab893-c77d-54f7-96c1-f31ebbdaba4a"
24-
build-id="1234567890"></idverse-sdk-ui>
27+
<idverse-sdk-ui
28+
session-url="YOUR_SESSION_URL"
29+
session-token="YOUR_SESSION_TOKEN"
30+
session-build-id="YOUR_SESSION_BUILD_ID"
31+
></idverse-sdk-ui>
2532

2633
<p class="read-the-docs">Click on the IDVerse logo to learn more</p>
2734
</div>
2835

29-
<router-outlet />
36+
<router-outlet />

sdk-integration-examples/web-sdk/angular/face-scan/src/app/app.component.scss

-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
transition: filter 300ms;
1313
}
1414

15-
.logo:hover {
16-
filter: drop-shadow(0 0 2em #646cffaa);
17-
}
18-
19-
.logo.react:hover {
20-
filter: drop-shadow(0 0 2em #61dafbaa);
21-
}
22-
2315
@keyframes logo-spin {
2416
from {
2517
transform: rotate(0deg);

sdk-integration-examples/web-sdk/angular/face-scan/src/app/app.component.ts

+27-32
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,56 @@
1-
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
2-
import { CommonModule } from '@angular/common';
3-
import { RouterOutlet } from '@angular/router';
1+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
2+
import { CommonModule } from "@angular/common";
3+
import { RouterOutlet } from "@angular/router";
44
import {
55
IdverseSdkUiCustomEvent,
66
SdkError,
77
FaceScanRecognizerResult,
8-
} from '@idverse/idverse-sdk-browser/ui';
8+
} from "@idverse/idverse-sdk-browser/ui";
99
import { SdkType } from "@idverse/idverse-sdk-browser";
1010

11-
import '@idverse/idverse-sdk-browser/ui';
12-
import { DetailsComponent } from './details/details.component';
11+
import "@idverse/idverse-sdk-browser/ui";
1312

1413
@Component({
15-
selector: 'app-root',
14+
selector: "app-root",
1615
standalone: true,
17-
imports: [RouterOutlet, CommonModule, DetailsComponent],
18-
templateUrl: './app.component.html',
19-
styleUrl: './app.component.scss',
16+
imports: [RouterOutlet, CommonModule],
17+
templateUrl: "./app.component.html",
18+
styleUrl: "./app.component.scss",
2019
schemas: [CUSTOM_ELEMENTS_SCHEMA],
2120
})
2221
export class AppComponent {
23-
title = 'angluar-id-scan';
22+
title = "angluar-id-scan";
2423
private idverseSdk: HTMLIdverseSdkUiElement | null = null;
2524
loading: boolean = true;
2625
ready: boolean = false;
2726
errorText: string | null = null;
2827
resultData: FaceScanRecognizerResult | null = null;
2928

3029
private onSdkReady = () => {
31-
this.loading = false;
32-
this.ready = true;
33-
console.log('Successfully loaded');
30+
console.log("Successfully loaded");
3431
};
3532

36-
private onScanSuccess = (
37-
ev: IdverseSdkUiCustomEvent<any>
38-
) => {
33+
private onScanSuccess = (ev: IdverseSdkUiCustomEvent<any>) => {
3934
console.log(ev.detail);
40-
const res =
41-
ev as unknown as IdverseSdkUiCustomEvent<any>;
42-
this.resultData = res.detail;
35+
const res = ev as unknown as IdverseSdkUiCustomEvent<any>;
36+
this.resultData = res.detail.result.status;
4337
};
4438

4539
private onScanFail = (ev: IdverseSdkUiCustomEvent<any>) => {
46-
console.log('failed to scan.', ev);
40+
console.log("failed to scan.", ev);
4741
this.errorText = ev.detail.toString();
4842
};
4943

5044
private onError = (e: IdverseSdkUiCustomEvent<SdkError>) => {
5145
this.loading = false;
52-
console.error('SDKError', e.detail);
46+
console.error("SDKError", e.detail);
5347
this.errorText = e.detail.message.toString();
5448
};
5549

5650
private onAuthenticated = (ev: IdverseSdkUiCustomEvent<any>) => {
57-
console.log('authenticated', ev);
51+
console.log("authenticated", ev);
52+
this.loading = false;
53+
this.ready = true;
5854
};
5955

6056
private closeSession = () => {
@@ -72,19 +68,18 @@ export class AppComponent {
7268

7369
ngOnInit() {
7470
this.idverseSdk = document.querySelector(
75-
'idverse-sdk-ui'
71+
"idverse-sdk-ui"
7672
) as HTMLIdverseSdkUiElement;
7773
if (!this.idverseSdk) {
78-
throw 'idverse-sdk-ui tag does not exist';
74+
throw "idverse-sdk-ui tag does not exist";
7975
}
8076
this.idverseSdk.recognizers = [SdkType.FaceScan];
81-
this.idverseSdk.enableDFA = false;
82-
this.idverseSdk.enableFaceMatch = false;
83-
this.idverseSdk.addEventListener('ready', this.onSdkReady);
84-
this.idverseSdk.addEventListener('fatalError', this.onError);
85-
this.idverseSdk.addEventListener('scanFail', this.onScanFail);
86-
this.idverseSdk.addEventListener('scanSuccess', this.onScanSuccess);
87-
this.idverseSdk.addEventListener('authenticated', this.onAuthenticated);
77+
78+
this.idverseSdk.addEventListener("ready", this.onSdkReady);
79+
this.idverseSdk.addEventListener("fatalError", this.onError);
80+
this.idverseSdk.addEventListener("scanFail", this.onScanFail);
81+
this.idverseSdk.addEventListener("scanSuccess", this.onScanSuccess);
82+
this.idverseSdk.addEventListener("authenticated", this.onAuthenticated);
8883
}
8984

9085
onhandleStart() {

sdk-integration-examples/web-sdk/angular/face-scan/src/app/details/details.component.html

-22
This file was deleted.

sdk-integration-examples/web-sdk/angular/face-scan/src/app/details/details.component.scss

-111
This file was deleted.

sdk-integration-examples/web-sdk/angular/face-scan/src/app/details/details.component.spec.ts

-23
This file was deleted.

0 commit comments

Comments
 (0)