tracking-lib-ott 1.0.18 → 1.0.19

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 +10 -19
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,28 +4,20 @@ Thư viện tracking events dành cho các dự án OTT (Web, Smart TV).
4
4
 
5
5
  ## Cài đặt
6
6
 
7
- ```bash
7
+ ````bash
8
8
  npm install tracking-lib-ott
9
9
  # hoặc
10
10
  yarn add tracking-lib-ott
11
- ```
12
-
13
- ---
14
11
 
15
- ## API Endpoint
16
12
 
17
- | Property | Value |
18
- | ------------ | --------------------------------- |
19
- | Method | `POST` |
20
- | URL | `/v2/event_batch` |
21
- | Content-Type | `application/json` |
22
- | Giới hạn | Tối đa **200 events** mỗi request |
13
+ ## Session ID
23
14
 
24
- > **Cơ chế**: Thông tin chung đặt ở cấp top-level, phần sự kiện nằm trong mảng `events`. Server sẽ hợp nhất thông tin chung vào từng event trước khi gửi vào Kafka.
25
-
26
- ---
15
+ ```javascript
16
+ const sessionId = getOrCreateSessionId({
17
+ domain: window.location.hostname,
18
+ expirationMinutes: 30
19
+ })
27
20
 
28
- ## Sử dụng cơ bản
29
21
 
30
22
  ### 1. Khởi tạo (Init)
31
23
 
@@ -38,9 +30,8 @@ tracking.init({
38
30
 
39
31
  // Required fields
40
32
  appId: "ONPlus", // ONPlus, ONLiveTV
41
- packageId: "com.vtvcab.onsportstv",
42
- sessionId: "uuid-v4-session-id", // Hoặc để trống sẽ tự động tạo từ cookie
43
- sessionSign: "md5_signature", // MD5(append(session_id, secret_key))
33
+ packageId: "Name of app",
34
+ sessionSign: "md5_signature", // MD5(append(sessionId, secret_key))
44
35
  deviceId: "device-unique-id",
45
36
  platform: "SmartTV", // WebPC | WebMobile | SmartTV | AndroidTV
46
37
  deviceModel: "Samsung TV 2024",
@@ -53,7 +44,7 @@ tracking.init({
53
44
  deviceOsVersion: "17.0",
54
45
  sdkVersion: "1.0.0",
55
46
  });
56
- ```
47
+ ````
57
48
 
58
49
  ### 2. Set User Info
59
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tracking-lib-ott",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",