@abto-app/event 0.1.1 → 0.1.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.
- package/README.md +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,8 +52,8 @@ export const events = defineEvents({
|
|
|
52
52
|
description: '결제가 완료됨',
|
|
53
53
|
properties: {
|
|
54
54
|
order_id: { type: 'string', required: true },
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
value: { type: 'number', required: true },
|
|
56
|
+
scale: {
|
|
57
57
|
type: 'string',
|
|
58
58
|
enum: ['KRW', 'USD'],
|
|
59
59
|
required: true,
|
|
@@ -75,11 +75,15 @@ const abto = initAbto({
|
|
|
75
75
|
|
|
76
76
|
abto.capture('checkout_completed', {
|
|
77
77
|
order_id: 'order_123',
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
value: 49_000,
|
|
79
|
+
scale: 'KRW',
|
|
80
80
|
});
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
`value`와 `scale`은 Success Metric이 읽는 metric 필드로 승격되는 예약 이름이다.
|
|
84
|
+
금액이나 개수처럼 집계할 수치는 이 두 이름으로 실어야 하며,
|
|
85
|
+
다른 이름의 property는 `extra_json`에만 남아 전환 건수로만 쓰인다.
|
|
86
|
+
|
|
83
87
|
`defineEvents()`에서 타입을 추론하므로 잘못된 이벤트 이름, required 누락, enum 위반을 개발 시점에 확인할 수 있다. 런타임 정책은 환경별로 다르다.
|
|
84
88
|
|
|
85
89
|
| 환경 | 미등록 이벤트 | 등록 schema drift |
|