@bytem/bytem-tracker-app 0.0.17 → 0.0.18
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 +5 -2
- package/dist/package.json +1 -1
- package/dist/src/business/trackPayOrder.js +1 -2
- package/dist/test/additionalMethods.test.js +1 -0
- package/dist/test/setup.js +0 -7
- package/package.json +1 -1
- package/dist/src/business/trackUser.d.ts +0 -2
- package/dist/src/business/trackUser.js +0 -13
package/README.md
CHANGED
|
@@ -7,7 +7,10 @@ This is the official Bytem Tracker SDK for React Native applications.
|
|
|
7
7
|
Install the package using Yarn:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
# need
|
|
11
|
+
yarn add @bytem/bytem-tracker-app
|
|
12
|
+
# if not
|
|
13
|
+
yarn add @react-native-async-storage/async-storage
|
|
11
14
|
```
|
|
12
15
|
|
|
13
16
|
### iOS Setup
|
|
@@ -31,7 +34,7 @@ const App = () => {
|
|
|
31
34
|
await BytemTracker.init({
|
|
32
35
|
appKey: 'your-app-key',
|
|
33
36
|
endpoint: 'https://api.bytem.com/track',
|
|
34
|
-
debug:
|
|
37
|
+
debug: false, // Enable debug logs in development
|
|
35
38
|
});
|
|
36
39
|
};
|
|
37
40
|
|
package/dist/package.json
CHANGED
|
@@ -9,6 +9,7 @@ global.fetch = jest.fn(() => Promise.resolve({
|
|
|
9
9
|
ok: true,
|
|
10
10
|
status: 200,
|
|
11
11
|
json: () => Promise.resolve({ status: 'success' }),
|
|
12
|
+
text: () => Promise.resolve('{"status":"success"}'),
|
|
12
13
|
}));
|
|
13
14
|
describe('BytemTracker Additional Methods', () => {
|
|
14
15
|
const mockConfig = {
|
package/dist/test/setup.js
CHANGED
|
@@ -19,13 +19,6 @@ jest.mock('@react-native-async-storage/async-storage', () => ({
|
|
|
19
19
|
return Promise.resolve(null);
|
|
20
20
|
}),
|
|
21
21
|
}));
|
|
22
|
-
// Mock React Native Device Info
|
|
23
|
-
jest.mock('react-native-device-info', () => ({
|
|
24
|
-
getSystemName: jest.fn(() => 'iOS'),
|
|
25
|
-
getSystemVersion: jest.fn(() => '14.0'),
|
|
26
|
-
getModel: jest.fn(() => 'iPhone 11'),
|
|
27
|
-
getUserAgent: jest.fn(() => Promise.resolve('Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X)')),
|
|
28
|
-
}), { virtual: true });
|
|
29
22
|
// Mock React Native
|
|
30
23
|
jest.mock('react-native', () => ({
|
|
31
24
|
Platform: {
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.trackUser = void 0;
|
|
4
|
-
const trackUser = (userId, traits = {}) => {
|
|
5
|
-
return {
|
|
6
|
-
event: 'identify',
|
|
7
|
-
params: {
|
|
8
|
-
user_id: userId,
|
|
9
|
-
traits: traits,
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.trackUser = trackUser;
|