@mrrocket/sdk 0.3.0 → 0.8.0

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 (64) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +240 -5
  3. package/dist/api.d.ts +23 -3
  4. package/dist/api.js +7 -3
  5. package/dist/api.js.map +1 -1
  6. package/dist/batch.d.ts +33 -0
  7. package/dist/batch.js +50 -0
  8. package/dist/batch.js.map +1 -0
  9. package/dist/browser/mrrocket-flows.js +64 -0
  10. package/dist/browser/mrrocket-push.js +1 -0
  11. package/dist/browser/mrrocket-replay.js +78 -0
  12. package/dist/browser/mrrocket-sw.js +1 -0
  13. package/dist/browser/mrrocket.js +2 -0
  14. package/dist/browser.d.ts +1 -1
  15. package/dist/browser.js +3 -1
  16. package/dist/browser.js.map +1 -1
  17. package/dist/client.d.ts +36 -1
  18. package/dist/client.js +163 -83
  19. package/dist/client.js.map +1 -1
  20. package/dist/context.d.ts +10 -0
  21. package/dist/context.js.map +1 -1
  22. package/dist/core.d.ts +91 -4
  23. package/dist/core.js +83 -6
  24. package/dist/core.js.map +1 -1
  25. package/dist/feedback.d.ts +19 -4
  26. package/dist/feedback.js +652 -190
  27. package/dist/feedback.js.map +1 -1
  28. package/dist/flows-ui.d.ts +23 -0
  29. package/dist/flows-ui.js +384 -0
  30. package/dist/flows-ui.js.map +1 -0
  31. package/dist/flows-web.d.ts +19 -0
  32. package/dist/flows-web.js +42 -0
  33. package/dist/flows-web.js.map +1 -0
  34. package/dist/flows.d.ts +222 -0
  35. package/dist/flows.js +409 -0
  36. package/dist/flows.js.map +1 -0
  37. package/dist/index.d.ts +5 -2
  38. package/dist/index.js +9 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/proxy.d.ts +34 -1
  41. package/dist/proxy.js +14 -1
  42. package/dist/proxy.js.map +1 -1
  43. package/dist/push-web.d.ts +43 -0
  44. package/dist/push-web.js +81 -0
  45. package/dist/push-web.js.map +1 -0
  46. package/dist/react-native/index.d.cts +561 -0
  47. package/dist/react-native/index.d.ts +561 -0
  48. package/dist/react-native/index.js +1743 -0
  49. package/dist/react-native/index.js.map +1 -0
  50. package/dist/react-native/package.json +3 -0
  51. package/dist/referral.d.ts +6 -0
  52. package/dist/referral.js +7 -3
  53. package/dist/referral.js.map +1 -1
  54. package/dist/styles.d.ts +1 -1
  55. package/dist/styles.js +127 -24
  56. package/dist/styles.js.map +1 -1
  57. package/dist/ui.d.ts +3 -0
  58. package/dist/ui.js +12 -0
  59. package/dist/ui.js.map +1 -1
  60. package/dist/web-state.d.ts +36 -0
  61. package/dist/web-state.js +64 -0
  62. package/dist/web-state.js.map +1 -0
  63. package/package.json +64 -6
  64. package/react-native/package.json +7 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mrrocket/sdk",
3
- "version": "0.3.0",
4
- "description": "MRRocket SDK: page views, events, heatmap clicks, session recordings, A/B tests, feedback board and surveys that your MRRocket agents can run and read. Next.js today (@mrrocket/sdk/next), more frameworks next.",
3
+ "version": "0.8.0",
4
+ "description": "MRRocket SDK: page views, events, heatmap clicks, session recordings, A/B tests, feature flags, error tracking, feedback board, surveys, a cancel flow, onboarding tours and checklists, in-app messages, push notifications and redirect tests that your MRRocket agents can run and read. Next.js (@mrrocket/sdk/next), React Native and Expo (@mrrocket/sdk/react-native), and a script tag for any website.",
5
5
  "keywords": [
6
6
  "nextjs",
7
7
  "analytics",
@@ -14,7 +14,10 @@
14
14
  "mrrocket",
15
15
  "cloudflare-workers",
16
16
  "react",
17
- "sdk"
17
+ "sdk",
18
+ "react-native",
19
+ "expo",
20
+ "script-tag"
18
21
  ],
19
22
  "license": "MIT",
20
23
  "type": "module",
@@ -35,6 +38,14 @@
35
38
  "import": "./dist/proxy.js",
36
39
  "default": "./dist/proxy.js"
37
40
  },
41
+ "./react-native": {
42
+ "types": "./dist/react-native/index.d.ts",
43
+ "react-native": "./dist/react-native/index.js",
44
+ "require": "./dist/react-native/index.js",
45
+ "import": "./dist/react-native/index.js",
46
+ "default": "./dist/react-native/index.js"
47
+ },
48
+ "./browser": "./dist/browser/mrrocket.js",
38
49
  "./package.json": "./package.json"
39
50
  },
40
51
  "typesVersions": {
@@ -47,11 +58,15 @@
47
58
  ],
48
59
  "next/proxy": [
49
60
  "./dist/proxy.d.ts"
61
+ ],
62
+ "react-native": [
63
+ "./dist/react-native/index.d.ts"
50
64
  ]
51
65
  }
52
66
  },
53
67
  "files": [
54
68
  "dist",
69
+ "react-native",
55
70
  "README.md",
56
71
  "LICENSE",
57
72
  "CHANGELOG.md"
@@ -63,20 +78,63 @@
63
78
  "access": "public"
64
79
  },
65
80
  "scripts": {
66
- "build": "tsup && node scripts/build-types.mjs && node scripts/check-dist.mjs",
81
+ "build": "tsup && tsup --config tsup.native.config.mjs && tsup --config tsup.browser.config.mjs && node scripts/build-types.mjs && node scripts/check-dist.mjs",
67
82
  "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
68
83
  "typecheck": "tsc --noEmit",
69
84
  "test": "node --import tsx --test test/*.test.ts",
70
85
  "check:dist": "node scripts/check-dist.mjs",
71
86
  "check:publish": "node scripts/check-publish.mjs",
72
- "prepublishOnly": "npm run check:publish && npm run typecheck && npm run build"
87
+ "prepublishOnly": "npm run check:publish && npm run typecheck && npm run build",
88
+ "build:script": "tsup --config tsup.browser.config.mjs",
89
+ "sync:app": "npm run build && node scripts/sync-app.mjs"
73
90
  },
74
91
  "dependencies": {
75
92
  "@rrweb/record": "2.1.6"
76
93
  },
77
94
  "peerDependencies": {
95
+ "@react-native-async-storage/async-storage": ">=1.17",
96
+ "expo-application": ">=5",
97
+ "expo-device": ">=5",
98
+ "expo-constants": ">=14",
99
+ "expo-localization": ">=14",
100
+ "expo-notifications": ">=0.20",
101
+ "expo-router": ">=3",
78
102
  "next": ">=15",
79
- "react": ">=19"
103
+ "react": ">=18",
104
+ "react-dom": ">=18",
105
+ "react-native": ">=0.72"
106
+ },
107
+ "peerDependenciesMeta": {
108
+ "@react-native-async-storage/async-storage": {
109
+ "optional": true
110
+ },
111
+ "expo-application": {
112
+ "optional": true
113
+ },
114
+ "expo-device": {
115
+ "optional": true
116
+ },
117
+ "expo-constants": {
118
+ "optional": true
119
+ },
120
+ "expo-localization": {
121
+ "optional": true
122
+ },
123
+ "expo-notifications": {
124
+ "optional": true
125
+ },
126
+ "expo-router": {
127
+ "optional": true
128
+ },
129
+ "next": {
130
+ "optional": true
131
+ },
132
+ "react-dom": {
133
+ "optional": true
134
+ },
135
+ "react-native": {
136
+ "optional": true
137
+ }
80
138
  },
81
139
  "devDependencies": {
82
140
  "@types/node": "^22",
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@mrrocket/sdk/react-native",
3
+ "private": true,
4
+ "main": "../dist/react-native/index.js",
5
+ "react-native": "../dist/react-native/index.js",
6
+ "types": "../dist/react-native/index.d.ts"
7
+ }