@qredex/react 1.0.1 → 1.0.3
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 +17 -32
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
▄▄▄▄
|
|
3
|
-
▄█▀▀███▄▄ █▄
|
|
4
|
-
██ ██ ▄ ██
|
|
5
|
-
██ ██ ████▄▄█▀█▄ ▄████ ▄█▀█▄▀██ ██▀
|
|
6
|
-
██ ▄ ██ ██ ██▄█▀ ██ ██ ██▄█▀ ███
|
|
7
|
-
▀█████▄▄█▀ ▄▀█▄▄▄▄█▀███▄▀█▄▄▄▄██ ██▄
|
|
8
|
-
▀█
|
|
9
|
-
|
|
10
|
-
Copyright (C) 2026 — 2026, Qredex, LTD. All Rights Reserved.
|
|
11
|
-
|
|
12
|
-
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
13
|
-
|
|
14
|
-
This file is part of the Qredex Agent SDK and is licensed under the MIT License. See LICENSE.
|
|
15
|
-
Redistribution and use are permitted under that license.
|
|
16
|
-
|
|
17
|
-
If you need additional information or have any questions, please email: copyright@qredex.com
|
|
18
|
-
-->
|
|
1
|
+
span
|
|
19
2
|
|
|
20
3
|
# @qredex/react
|
|
21
4
|
|
|
@@ -34,7 +17,7 @@ npm install @qredex/react
|
|
|
34
17
|
|
|
35
18
|
## Attribution Flow
|
|
36
19
|
|
|
37
|
-

|
|
20
|
+

|
|
38
21
|
|
|
39
22
|
Call `useQredexAgent()`, then forward merchant cart state with `agent.handleCartChange(...)`, read the PIT with `agent.getPurchaseIntentToken()`, and clear attribution with `agent.handleCartEmpty()`. Only call `agent.handlePaymentSuccess()` if your platform has no cart-empty step after checkout.
|
|
40
23
|
|
|
@@ -102,20 +85,22 @@ export function QredexCartBridge({ itemCount }: QredexCartBridgeProps) {
|
|
|
102
85
|
|
|
103
86
|
## What To Call When
|
|
104
87
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
|
108
|
-
| Cart
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
88
|
+
|
|
89
|
+
| Merchant event | Call | Why |
|
|
90
|
+
| -------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
|
|
91
|
+
| Cart becomes non-empty | `agent.handleCartChange({ itemCount, previousCount })` | Gives Qredex the live cart state so IIT can lock to PIT |
|
|
92
|
+
| Cart changes while still non-empty | `agent.handleCartChange(...)` | Safe retry path on the next merchant-reported non-empty cart event if a previous lock failed |
|
|
93
|
+
| Clear cart action | `clearCart() -> agent.handleCartEmpty()` | Clears IIT/PIT from the live session |
|
|
94
|
+
| Need PIT for order submission | `state.pit` or `agent.getPurchaseIntentToken()` | Attach PIT to the checkout payload |
|
|
95
|
+
| Checkout completes without a cart-empty step | `agent.handlePaymentSuccess()` | Optional explicit cleanup path |
|
|
112
96
|
|
|
113
97
|
## API Surface
|
|
114
98
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
|
99
|
+
|
|
100
|
+
| Export | Use |
|
|
101
|
+
| ------------------ | ---------------------------------------------------------- |
|
|
102
|
+
| `useQredexAgent()` | Primary React hook. Returns`{ agent, state }` |
|
|
118
103
|
| `useQredexState()` | State-only hook if you already have agent access elsewhere |
|
|
119
|
-
| `getQredexAgent()` | Direct access to the singleton runtime
|
|
120
|
-
| `initQredex()`
|
|
121
|
-
| `QredexAgent`
|
|
104
|
+
| `getQredexAgent()` | Direct access to the singleton runtime |
|
|
105
|
+
| `initQredex()` | Explicit browser init when needed |
|
|
106
|
+
| `QredexAgent` | Re-export of the core agent |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qredex/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React wrapper for Qredex Agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsc -p tsconfig.json"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@qredex/agent": "^1.0.
|
|
25
|
+
"@qredex/agent": "^1.0.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@qredex/agent": "file:../.."
|