@qredex/react 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +1 -26
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -34,32 +34,7 @@ npm install @qredex/react
34
34
 
35
35
  ## Attribution Flow
36
36
 
37
- ```mermaid
38
- sequenceDiagram
39
- participant User
40
- participant Storefront as Your cart UI
41
- participant Wrapper as useQredexAgent()
42
- participant Agent as QredexAgent
43
-
44
- User->>Storefront: Land with ?qdx_intent=iit_xxx
45
- Storefront->>Wrapper: useQredexAgent()
46
- Note right of Agent: Captures IIT automatically<br/>No function call needed
47
-
48
- User->>Storefront: Cart item count changes
49
- Storefront->>Agent: agent.handleCartChange({ itemCount, previousCount })
50
- Note right of Agent: Locks IIT to PIT internally when lockable
51
-
52
- User->>Storefront: Checkout
53
- Storefront->>Agent: agent.getPurchaseIntentToken()
54
- Note right of Storefront: Send PIT with the order to your backend
55
-
56
- User->>Storefront: Cart is cleared
57
- Storefront->>Agent: agent.handleCartEmpty()
58
-
59
- opt No cart-empty step after checkout
60
- Storefront->>Agent: agent.handlePaymentSuccess()
61
- end
62
- ```
37
+ ![React wrapper attribution flow](https://raw.githubusercontent.com/Qredex/qredex-agent/main/docs/diagrams/wrapper-attribution-sequence.svg)
63
38
 
64
39
  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.
65
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qredex/react",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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.0"
25
+ "@qredex/agent": "^1.0.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@qredex/agent": "file:../.."