@trust-proto/auth-react 0.2.0 → 0.4.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 +15 -6
- package/build/index.js +1 -1
- package/lib/liberion-auth.js +1 -0
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -12,18 +12,27 @@ Install the npm package:
|
|
|
12
12
|
npm i @trust-proto/auth-react
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Standalone Browser Usage (CDN)
|
|
16
|
+
|
|
17
|
+
**CDN Options:**
|
|
18
|
+
- unpkg: `https://unpkg.com/@trust-proto/auth-react@{version}/lib/liberion-auth.js`
|
|
19
|
+
- jsDelivr: `https://cdn.jsdelivr.net/npm/@trust-proto/auth-react@{version}/lib/liberion-auth.js`
|
|
20
|
+
- GitHub Releases: Download from [releases page](https://github.com/liberion-official/auth-sdk-ts/releases)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
15
24
|
### React Example with NPM Package
|
|
16
25
|
|
|
17
26
|
**Props:**
|
|
18
27
|
|
|
19
28
|
| Parameter | Type | Required | Description |
|
|
20
29
|
| ------------ | ---------- | -------- | ------------------------------------------------------------------ |
|
|
21
|
-
| `backendUrl` | `string` | ✅
|
|
22
|
-
| `isOpen` | `boolean` | ✅
|
|
23
|
-
| `theme` | `string` | ❌
|
|
24
|
-
| `successCb` | `function` | ❌
|
|
25
|
-
| `failedCb` | `function` | ❌
|
|
26
|
-
| `closeCb` | `function` | ❌
|
|
30
|
+
| `backendUrl` | `string` | ✅ | WebSocket authentication server URL |
|
|
31
|
+
| `isOpen` | `boolean` | ✅ | Controls widget visibility (true/false) |
|
|
32
|
+
| `theme` | `string` | ❌ | Theme mode: `'light'` or `'dark'` (default: `'dark'`) |
|
|
33
|
+
| `successCb` | `function` | ❌ | Callback function called on success. Receives authentication token |
|
|
34
|
+
| `failedCb` | `function` | ❌ | Callback function called on error. |
|
|
35
|
+
| `closeCb` | `function` | ❌ | Callback function called when widget is closed |
|
|
27
36
|
|
|
28
37
|
Import the widget into your React application:
|
|
29
38
|
|