@qredex/svelte 1.0.0 → 1.0.1
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 +1 -26
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,32 +34,7 @@ npm install @qredex/svelte
|
|
|
34
34
|
|
|
35
35
|
## Attribution Flow
|
|
36
36
|
|
|
37
|
-
|
|
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
|
+

|
|
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/svelte",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Svelte 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.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@qredex/agent": "file:../.."
|