@glideidentity/web-client-sdk 4.4.10 → 5.0.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.
- package/README.md +59 -11
- package/dist/adapters/react/index.d.ts +1 -1
- package/dist/adapters/vue/index.d.ts +1 -1
- package/dist/browser/web-client-sdk.min.js +1 -1
- package/dist/browser/web-client-sdk.min.js.LICENSE.txt +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/core/phone-auth/api-types.d.ts +0 -13
- package/dist/core/phone-auth/client.js +0 -8
- package/dist/core/phone-auth/index.d.ts +1 -1
- package/dist/core/phone-auth/index.js +1 -2
- package/dist/core/phone-auth/validation-utils.d.ts +0 -13
- package/dist/core/phone-auth/validation-utils.js +0 -41
- package/dist/core/version.js +1 -1
- package/dist/esm/adapters/react/index.d.ts +1 -1
- package/dist/esm/adapters/vue/index.d.ts +1 -1
- package/dist/esm/browser.d.ts +1 -1
- package/dist/esm/core/phone-auth/api-types.d.ts +0 -13
- package/dist/esm/core/phone-auth/client.js +1 -9
- package/dist/esm/core/phone-auth/index.d.ts +1 -1
- package/dist/esm/core/phone-auth/index.js +1 -1
- package/dist/esm/core/phone-auth/validation-utils.d.ts +0 -13
- package/dist/esm/core/phone-auth/validation-utils.js +0 -40
- package/dist/esm/core/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ The official web SDK for integrating Glide's carrier-grade phone verification in
|
|
|
29
29
|
## Table of Contents
|
|
30
30
|
|
|
31
31
|
- [Installation](#installation)
|
|
32
|
+
- [Development](#development)
|
|
32
33
|
- [Quick Start](#quick-start)
|
|
33
34
|
- [Extended Mode - Advanced Control](#extended-mode---advanced-control)
|
|
34
35
|
- [Authentication Strategies](#authentication-strategies)
|
|
@@ -36,6 +37,7 @@ The official web SDK for integrating Glide's carrier-grade phone verification in
|
|
|
36
37
|
- [Error Handling](#error-handling)
|
|
37
38
|
- [Browser Support](#browser-support)
|
|
38
39
|
- [API Reference](#api-reference)
|
|
40
|
+
- [Documentation](#documentation)
|
|
39
41
|
|
|
40
42
|
## Installation
|
|
41
43
|
|
|
@@ -43,6 +45,34 @@ The official web SDK for integrating Glide's carrier-grade phone verification in
|
|
|
43
45
|
npm install @glideidentity/web-client-sdk
|
|
44
46
|
```
|
|
45
47
|
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
### Using Docker (Recommended)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Build the SDK
|
|
54
|
+
docker compose run --rm build
|
|
55
|
+
|
|
56
|
+
# Run tests
|
|
57
|
+
docker compose run --rm test
|
|
58
|
+
|
|
59
|
+
# Interactive development shell
|
|
60
|
+
docker compose run --rm dev
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Without Docker
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Install dependencies
|
|
67
|
+
npm install
|
|
68
|
+
|
|
69
|
+
# Build the SDK
|
|
70
|
+
npm run build
|
|
71
|
+
|
|
72
|
+
# Run tests
|
|
73
|
+
npm test
|
|
74
|
+
```
|
|
75
|
+
|
|
46
76
|
## Quick Start
|
|
47
77
|
|
|
48
78
|
### React Example
|
|
@@ -69,7 +99,7 @@ function PhoneVerification() {
|
|
|
69
99
|
const credential = await phoneAuth.invokeSecurePrompt(prepareResult);
|
|
70
100
|
|
|
71
101
|
// Process the credential
|
|
72
|
-
const result = await phoneAuth.
|
|
102
|
+
const result = await phoneAuth.getPhoneNumber(
|
|
73
103
|
credential,
|
|
74
104
|
prepareResult.session
|
|
75
105
|
);
|
|
@@ -92,7 +122,7 @@ function PhoneVerification() {
|
|
|
92
122
|
const credential = await phoneAuth.invokeSecurePrompt(prepareResult);
|
|
93
123
|
|
|
94
124
|
// Verify the number
|
|
95
|
-
const result = await phoneAuth.
|
|
125
|
+
const result = await phoneAuth.verifyPhoneNumber(
|
|
96
126
|
credential,
|
|
97
127
|
prepareResult.session
|
|
98
128
|
);
|
|
@@ -307,7 +337,7 @@ if (isExtendedResponse(result)) {
|
|
|
307
337
|
}
|
|
308
338
|
} else {
|
|
309
339
|
// Standard mode - got credential directly
|
|
310
|
-
const verified = await phoneAuth.
|
|
340
|
+
const verified = await phoneAuth.verifyPhoneNumber(result, session);
|
|
311
341
|
}
|
|
312
342
|
```
|
|
313
343
|
|
|
@@ -348,7 +378,7 @@ async function verifyPhone() {
|
|
|
348
378
|
});
|
|
349
379
|
|
|
350
380
|
const credential = await phoneAuth.invokeSecurePrompt(prepared);
|
|
351
|
-
result.value = await phoneAuth.
|
|
381
|
+
result.value = await phoneAuth.verifyPhoneNumber(
|
|
352
382
|
credential,
|
|
353
383
|
prepared.session
|
|
354
384
|
);
|
|
@@ -397,7 +427,7 @@ export class PhoneVerifyComponent {
|
|
|
397
427
|
});
|
|
398
428
|
|
|
399
429
|
const credential = await this.phoneAuth.invokeSecurePrompt(prepared);
|
|
400
|
-
this.result = await this.phoneAuth.
|
|
430
|
+
this.result = await this.phoneAuth.verifyPhoneNumber(
|
|
401
431
|
credential,
|
|
402
432
|
prepared.session
|
|
403
433
|
);
|
|
@@ -430,7 +460,7 @@ async function getPhoneNumber() {
|
|
|
430
460
|
|
|
431
461
|
const credential = await client.invokeSecurePrompt(prepareResult);
|
|
432
462
|
|
|
433
|
-
const result = await client.
|
|
463
|
+
const result = await client.getPhoneNumber(
|
|
434
464
|
credential,
|
|
435
465
|
prepareResult.session
|
|
436
466
|
);
|
|
@@ -567,19 +597,18 @@ interface InvokeOptions {
|
|
|
567
597
|
### Methods
|
|
568
598
|
|
|
569
599
|
```typescript
|
|
570
|
-
// Core methods
|
|
600
|
+
// Core methods (granular control)
|
|
571
601
|
preparePhoneRequest(options: PrepareRequest): Promise<PrepareResponse>
|
|
572
602
|
invokeSecurePrompt(response: PrepareResponse, options?: InvokeOptions): Promise<any>
|
|
573
|
-
|
|
574
|
-
|
|
603
|
+
getPhoneNumber(credential: any, session: SessionInfo): Promise<GetPhoneNumberResponse>
|
|
604
|
+
verifyPhoneNumber(credential: any, session: SessionInfo): Promise<VerifyPhoneNumberResponse>
|
|
575
605
|
|
|
576
|
-
// High-level convenience methods
|
|
606
|
+
// High-level convenience methods (full flow)
|
|
577
607
|
getPhoneNumberComplete(): Promise<GetPhoneNumberResponse>
|
|
578
608
|
verifyPhoneNumberComplete(phoneNumber: string): Promise<VerifyPhoneNumberResponse>
|
|
579
609
|
|
|
580
610
|
// Utility methods
|
|
581
611
|
isSupported(): boolean
|
|
582
|
-
cancelCurrentRequest(): void
|
|
583
612
|
```
|
|
584
613
|
|
|
585
614
|
### Response Types
|
|
@@ -609,6 +638,25 @@ interface VerifyPhoneNumberResponse {
|
|
|
609
638
|
}
|
|
610
639
|
```
|
|
611
640
|
|
|
641
|
+
## Documentation
|
|
642
|
+
|
|
643
|
+
For detailed documentation, see the [docs](./docs) folder:
|
|
644
|
+
|
|
645
|
+
| Document | Description |
|
|
646
|
+
|----------|-------------|
|
|
647
|
+
| [Architecture](./docs/architecture.md) | SDK architecture and design principles |
|
|
648
|
+
| [Phone Authentication](./docs/phone-auth.md) | Complete phone auth usage guide |
|
|
649
|
+
| [Desktop Authentication](./docs/desktop-auth.md) | QR code authentication flow |
|
|
650
|
+
| [Dual Platform QR](./docs/dual-platform-qr.md) | iOS/Android specific QR codes |
|
|
651
|
+
| [Error Handling](./docs/error-handling.md) | Error codes and handling strategies |
|
|
652
|
+
| [Trigger Pattern](./docs/trigger-pattern.md) | Consistent trigger API across strategies |
|
|
653
|
+
| [Implementation Notes](./docs/implementation-notes.md) | Technical implementation details |
|
|
654
|
+
| [Local Development](./docs/local-development.md) | Testing the SDK locally |
|
|
655
|
+
| [TS43 Data Flow](./docs/TS43_DATA_FLOW.md) | Digital Credentials API details |
|
|
656
|
+
| [Type Hierarchy](./docs/TYPE_HIERARCHY.md) | TypeScript type system |
|
|
657
|
+
| [Naming Conventions](./docs/NAMING_CONVENTIONS.md) | API naming standards |
|
|
658
|
+
| [Security Checklist](./docs/security-checklist.md) | NPM publishing security |
|
|
659
|
+
|
|
612
660
|
## Support
|
|
613
661
|
|
|
614
662
|
- [Documentation](https://docs.glideidentity.com)
|
|
@@ -4,6 +4,6 @@ export type { UsePhoneAuthOptions } from './usePhoneAuth';
|
|
|
4
4
|
export type { ClientConfig, ClientResponse, RequestOptions } from '../../core/types';
|
|
5
5
|
export type { AuthConfig as PhoneAuthConfig, PhoneAuthOptions, PhoneAuthResult, AuthError, AuthStep } from '../../core/phone-auth';
|
|
6
6
|
export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isErrorCode, getRetryDelay, isRetryableError, serializeError, createErrorBreadcrumb } from '../../core/phone-auth';
|
|
7
|
-
export type { PhoneAuthCallbacks, PLMN, SessionInfo, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, ClientInfo,
|
|
7
|
+
export type { PhoneAuthCallbacks, PLMN, SessionInfo, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, ClientInfo, BrowserErrorType, BrowserErrorCodeType, BrowserNameType } from '../../core/phone-auth/types';
|
|
8
8
|
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from '../../core/phone-auth/types';
|
|
9
9
|
export { PhoneAuthClient } from '../../core/phone-auth';
|
|
@@ -5,6 +5,6 @@ export { PhoneAuthClient } from '../../core/phone-auth';
|
|
|
5
5
|
export type { ClientConfig, ClientResponse, RequestOptions } from '../../core/types';
|
|
6
6
|
export type { AuthConfig as PhoneAuthConfig, PhoneAuthOptions, PhoneAuthResult, AuthError, AuthStep } from '../../core/phone-auth';
|
|
7
7
|
export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isErrorCode, getRetryDelay, isRetryableError, serializeError, createErrorBreadcrumb } from '../../core/phone-auth';
|
|
8
|
-
export type { PhoneAuthCallbacks, PLMN, SessionInfo, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, ClientInfo,
|
|
8
|
+
export type { PhoneAuthCallbacks, PLMN, SessionInfo, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, ClientInfo, BrowserErrorType, BrowserErrorCodeType, BrowserNameType } from '../../core/phone-auth/types';
|
|
9
9
|
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from '../../core/phone-auth/types';
|
|
10
10
|
export { USE_CASE, ERROR_CODE, ERROR_MESSAGES, ERROR_STATUS_CODES } from '../../core/phone-auth/api-types';
|