@formo/analytics-react-native 0.1.4 → 1.0.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 (345) hide show
  1. package/README.md +25 -0
  2. package/lib/commonjs/FormoAnalytics.js +158 -79
  3. package/lib/commonjs/FormoAnalytics.js.map +1 -1
  4. package/lib/commonjs/FormoAnalyticsProvider.js +32 -26
  5. package/lib/commonjs/FormoAnalyticsProvider.js.map +1 -1
  6. package/lib/commonjs/constants/events.js +5 -1
  7. package/lib/commonjs/constants/events.js.map +1 -1
  8. package/lib/commonjs/constants/index.js +3 -3
  9. package/lib/commonjs/constants/storage.js +8 -1
  10. package/lib/commonjs/constants/storage.js.map +1 -1
  11. package/lib/commonjs/index.js +7 -7
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/lib/consent/index.js +8 -8
  14. package/lib/commonjs/lib/consent/index.js.map +1 -1
  15. package/lib/commonjs/lib/event/EventFactory.js +135 -52
  16. package/lib/commonjs/lib/event/EventFactory.js.map +1 -1
  17. package/lib/commonjs/lib/event/EventManager.js +6 -6
  18. package/lib/commonjs/lib/event/EventManager.js.map +1 -1
  19. package/lib/commonjs/lib/event/EventQueue.js +35 -24
  20. package/lib/commonjs/lib/event/EventQueue.js.map +1 -1
  21. package/lib/commonjs/lib/event/index.js +4 -4
  22. package/lib/commonjs/lib/installReferrer/index.js +193 -0
  23. package/lib/commonjs/lib/installReferrer/index.js.map +1 -0
  24. package/lib/commonjs/lib/lifecycle/index.js +24 -17
  25. package/lib/commonjs/lib/lifecycle/index.js.map +1 -1
  26. package/lib/commonjs/lib/session/index.js +13 -13
  27. package/lib/commonjs/lib/session/index.js.map +1 -1
  28. package/lib/commonjs/lib/storage/AsyncStorageAdapter.js +10 -10
  29. package/lib/commonjs/lib/storage/AsyncStorageAdapter.js.map +1 -1
  30. package/lib/commonjs/lib/storage/MemoryStorage.js +1 -1
  31. package/lib/commonjs/lib/storage/StorageBlueprint.js +2 -2
  32. package/lib/commonjs/lib/storage/StorageBlueprint.js.map +1 -1
  33. package/lib/commonjs/lib/storage/StorageManager.js +6 -6
  34. package/lib/commonjs/lib/storage/StorageManager.js.map +1 -1
  35. package/lib/commonjs/lib/storage/index.js +4 -4
  36. package/lib/commonjs/lib/wagmi/WagmiEventHandler.js +31 -36
  37. package/lib/commonjs/lib/wagmi/WagmiEventHandler.js.map +1 -1
  38. package/lib/commonjs/lib/wagmi/index.js +2 -2
  39. package/lib/commonjs/package.json +1 -0
  40. package/lib/commonjs/solana/address.js +110 -0
  41. package/lib/commonjs/solana/address.js.map +1 -0
  42. package/lib/commonjs/solana/index.js +28 -0
  43. package/lib/commonjs/solana/index.js.map +1 -0
  44. package/lib/commonjs/solana/types.js +47 -0
  45. package/lib/commonjs/solana/types.js.map +1 -0
  46. package/lib/commonjs/types/events.js.map +1 -1
  47. package/lib/commonjs/types/index.js +2 -2
  48. package/lib/commonjs/utils/address.js +60 -6
  49. package/lib/commonjs/utils/address.js.map +1 -1
  50. package/lib/commonjs/utils/hash.js +44 -6
  51. package/lib/commonjs/utils/hash.js.map +1 -1
  52. package/lib/commonjs/utils/index.js +5 -5
  53. package/lib/commonjs/utils/trafficSource.js +74 -13
  54. package/lib/commonjs/utils/trafficSource.js.map +1 -1
  55. package/lib/commonjs/version.js +1 -1
  56. package/lib/module/FormoAnalytics.js +107 -26
  57. package/lib/module/FormoAnalytics.js.map +1 -1
  58. package/lib/module/FormoAnalyticsProvider.js +21 -13
  59. package/lib/module/FormoAnalyticsProvider.js.map +1 -1
  60. package/lib/module/constants/config.js +2 -0
  61. package/lib/module/constants/config.js.map +1 -1
  62. package/lib/module/constants/events.js +6 -0
  63. package/lib/module/constants/events.js.map +1 -1
  64. package/lib/module/constants/index.js +5 -3
  65. package/lib/module/constants/index.js.map +1 -1
  66. package/lib/module/constants/storage.js +9 -0
  67. package/lib/module/constants/storage.js.map +1 -1
  68. package/lib/module/index.js +6 -4
  69. package/lib/module/index.js.map +1 -1
  70. package/lib/module/lib/consent/index.js +4 -2
  71. package/lib/module/lib/consent/index.js.map +1 -1
  72. package/lib/module/lib/event/EventFactory.js +116 -33
  73. package/lib/module/lib/event/EventFactory.js.map +1 -1
  74. package/lib/module/lib/event/EventManager.js +5 -3
  75. package/lib/module/lib/event/EventManager.js.map +1 -1
  76. package/lib/module/lib/event/EventQueue.js +18 -5
  77. package/lib/module/lib/event/EventQueue.js.map +1 -1
  78. package/lib/module/lib/event/index.js +6 -4
  79. package/lib/module/lib/event/index.js.map +1 -1
  80. package/lib/module/lib/event/types.js +2 -0
  81. package/lib/module/lib/installReferrer/index.js +189 -0
  82. package/lib/module/lib/installReferrer/index.js.map +1 -0
  83. package/lib/module/lib/lifecycle/index.js +14 -5
  84. package/lib/module/lib/lifecycle/index.js.map +1 -1
  85. package/lib/module/lib/logger/index.js +2 -0
  86. package/lib/module/lib/logger/index.js.map +1 -1
  87. package/lib/module/lib/session/index.js +5 -3
  88. package/lib/module/lib/session/index.js.map +1 -1
  89. package/lib/module/lib/storage/AsyncStorageAdapter.js +4 -2
  90. package/lib/module/lib/storage/AsyncStorageAdapter.js.map +1 -1
  91. package/lib/module/lib/storage/MemoryStorage.js +3 -1
  92. package/lib/module/lib/storage/MemoryStorage.js.map +1 -1
  93. package/lib/module/lib/storage/StorageBlueprint.js +3 -1
  94. package/lib/module/lib/storage/StorageBlueprint.js.map +1 -1
  95. package/lib/module/lib/storage/StorageManager.js +5 -3
  96. package/lib/module/lib/storage/StorageManager.js.map +1 -1
  97. package/lib/module/lib/storage/index.js +6 -4
  98. package/lib/module/lib/storage/index.js.map +1 -1
  99. package/lib/module/lib/storage/types.js +1 -1
  100. package/lib/module/lib/wagmi/WagmiEventHandler.js +5 -8
  101. package/lib/module/lib/wagmi/WagmiEventHandler.js.map +1 -1
  102. package/lib/module/lib/wagmi/index.js +4 -2
  103. package/lib/module/lib/wagmi/index.js.map +1 -1
  104. package/lib/module/lib/wagmi/types.js +1 -1
  105. package/lib/module/package.json +1 -0
  106. package/lib/module/solana/address.js +102 -0
  107. package/lib/module/solana/address.js.map +1 -0
  108. package/lib/module/solana/index.js +5 -0
  109. package/lib/module/solana/index.js.map +1 -0
  110. package/lib/module/solana/types.js +42 -0
  111. package/lib/module/solana/types.js.map +1 -0
  112. package/lib/module/types/base.js +2 -0
  113. package/lib/module/types/events.js +2 -0
  114. package/lib/module/types/events.js.map +1 -1
  115. package/lib/module/types/index.js +4 -2
  116. package/lib/module/types/index.js.map +1 -1
  117. package/lib/module/utils/address.js +60 -6
  118. package/lib/module/utils/address.js.map +1 -1
  119. package/lib/module/utils/hash.js +46 -6
  120. package/lib/module/utils/hash.js.map +1 -1
  121. package/lib/module/utils/helpers.js +2 -0
  122. package/lib/module/utils/helpers.js.map +1 -1
  123. package/lib/module/utils/index.js +7 -5
  124. package/lib/module/utils/index.js.map +1 -1
  125. package/lib/module/utils/timestamp.js +2 -0
  126. package/lib/module/utils/timestamp.js.map +1 -1
  127. package/lib/module/utils/trafficSource.js +64 -3
  128. package/lib/module/utils/trafficSource.js.map +1 -1
  129. package/lib/module/version.js +3 -1
  130. package/lib/module/version.js.map +1 -1
  131. package/lib/typescript/{FormoAnalytics.d.ts → commonjs/FormoAnalytics.d.ts} +23 -4
  132. package/lib/typescript/commonjs/FormoAnalytics.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/FormoAnalyticsProvider.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/constants/config.d.ts.map +1 -0
  135. package/lib/typescript/{constants → commonjs/constants}/events.d.ts +1 -0
  136. package/lib/typescript/commonjs/constants/events.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/constants/index.d.ts.map +1 -0
  138. package/lib/typescript/{constants → commonjs/constants}/storage.d.ts +3 -0
  139. package/lib/typescript/commonjs/constants/storage.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/lib/consent/index.d.ts.map +1 -0
  142. package/lib/typescript/{lib → commonjs/lib}/event/EventFactory.d.ts +36 -1
  143. package/lib/typescript/commonjs/lib/event/EventFactory.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/lib/event/EventManager.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/lib/event/EventQueue.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/lib/event/index.d.ts.map +1 -0
  147. package/lib/typescript/{lib → commonjs/lib}/event/types.d.ts +1 -1
  148. package/lib/typescript/commonjs/lib/event/types.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/lib/installReferrer/index.d.ts +39 -0
  150. package/lib/typescript/commonjs/lib/installReferrer/index.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/lib/lifecycle/index.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/lib/logger/index.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/lib/session/index.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/lib/storage/AsyncStorageAdapter.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/lib/storage/MemoryStorage.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/lib/storage/StorageBlueprint.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/lib/storage/StorageManager.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/lib/storage/index.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/lib/storage/types.d.ts.map +1 -0
  160. package/lib/typescript/{lib → commonjs/lib}/wagmi/WagmiEventHandler.d.ts +0 -1
  161. package/lib/typescript/commonjs/lib/wagmi/WagmiEventHandler.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/lib/wagmi/index.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/lib/wagmi/types.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/package.json +1 -0
  165. package/lib/typescript/commonjs/solana/address.d.ts +42 -0
  166. package/lib/typescript/commonjs/solana/address.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/solana/index.d.ts +3 -0
  168. package/lib/typescript/commonjs/solana/index.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/solana/types.d.ts +34 -0
  170. package/lib/typescript/commonjs/solana/types.d.ts.map +1 -0
  171. package/lib/typescript/{types → commonjs/types}/base.d.ts +39 -1
  172. package/lib/typescript/commonjs/types/base.d.ts.map +1 -0
  173. package/lib/typescript/{types → commonjs/types}/events.d.ts +1 -1
  174. package/lib/typescript/commonjs/types/events.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/utils/address.d.ts +45 -0
  177. package/lib/typescript/commonjs/utils/address.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/utils/hash.d.ts +18 -0
  179. package/lib/typescript/commonjs/utils/hash.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/utils/helpers.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/utils/index.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/utils/timestamp.d.ts.map +1 -0
  183. package/lib/typescript/{utils → commonjs/utils}/trafficSource.d.ts +16 -0
  184. package/lib/typescript/commonjs/utils/trafficSource.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/version.d.ts +2 -0
  186. package/lib/typescript/commonjs/version.d.ts.map +1 -0
  187. package/lib/typescript/module/FormoAnalytics.d.ts +182 -0
  188. package/lib/typescript/module/FormoAnalytics.d.ts.map +1 -0
  189. package/lib/typescript/module/FormoAnalyticsProvider.d.ts +29 -0
  190. package/lib/typescript/module/FormoAnalyticsProvider.d.ts.map +1 -0
  191. package/lib/typescript/module/constants/config.d.ts +8 -0
  192. package/lib/typescript/module/constants/config.d.ts.map +1 -0
  193. package/lib/typescript/module/constants/events.d.ts +24 -0
  194. package/lib/typescript/module/constants/events.d.ts.map +1 -0
  195. package/lib/typescript/module/constants/index.d.ts +4 -0
  196. package/lib/typescript/module/constants/index.d.ts.map +1 -0
  197. package/lib/typescript/module/constants/storage.d.ts +13 -0
  198. package/lib/typescript/module/constants/storage.d.ts.map +1 -0
  199. package/lib/typescript/module/index.d.ts +44 -0
  200. package/lib/typescript/module/index.d.ts.map +1 -0
  201. package/lib/typescript/module/lib/consent/index.d.ts +13 -0
  202. package/lib/typescript/module/lib/consent/index.d.ts.map +1 -0
  203. package/lib/typescript/module/lib/event/EventFactory.d.ts +99 -0
  204. package/lib/typescript/module/lib/event/EventFactory.d.ts.map +1 -0
  205. package/lib/typescript/module/lib/event/EventManager.d.ts +17 -0
  206. package/lib/typescript/module/lib/event/EventManager.d.ts.map +1 -0
  207. package/lib/typescript/module/lib/event/EventQueue.d.ts +74 -0
  208. package/lib/typescript/module/lib/event/EventQueue.d.ts.map +1 -0
  209. package/lib/typescript/module/lib/event/index.d.ts +5 -0
  210. package/lib/typescript/module/lib/event/index.d.ts.map +1 -0
  211. package/lib/typescript/module/lib/event/types.d.ts +23 -0
  212. package/lib/typescript/module/lib/event/types.d.ts.map +1 -0
  213. package/lib/typescript/module/lib/installReferrer/index.d.ts +39 -0
  214. package/lib/typescript/module/lib/installReferrer/index.d.ts.map +1 -0
  215. package/lib/typescript/module/lib/lifecycle/index.d.ts +46 -0
  216. package/lib/typescript/module/lib/lifecycle/index.d.ts.map +1 -0
  217. package/lib/typescript/module/lib/logger/index.d.ts +19 -0
  218. package/lib/typescript/module/lib/logger/index.d.ts.map +1 -0
  219. package/lib/typescript/module/lib/session/index.d.ts +41 -0
  220. package/lib/typescript/module/lib/session/index.d.ts.map +1 -0
  221. package/lib/typescript/module/lib/storage/AsyncStorageAdapter.d.ts +48 -0
  222. package/lib/typescript/module/lib/storage/AsyncStorageAdapter.d.ts.map +1 -0
  223. package/lib/typescript/module/lib/storage/MemoryStorage.d.ts +18 -0
  224. package/lib/typescript/module/lib/storage/MemoryStorage.d.ts.map +1 -0
  225. package/lib/typescript/module/lib/storage/StorageBlueprint.d.ts +21 -0
  226. package/lib/typescript/module/lib/storage/StorageBlueprint.d.ts.map +1 -0
  227. package/lib/typescript/module/lib/storage/StorageManager.d.ts +45 -0
  228. package/lib/typescript/module/lib/storage/StorageManager.d.ts.map +1 -0
  229. package/lib/typescript/module/lib/storage/index.d.ts +5 -0
  230. package/lib/typescript/module/lib/storage/index.d.ts.map +1 -0
  231. package/lib/typescript/module/lib/storage/types.d.ts +22 -0
  232. package/lib/typescript/module/lib/storage/types.d.ts.map +1 -0
  233. package/lib/typescript/module/lib/wagmi/WagmiEventHandler.d.ts +103 -0
  234. package/lib/typescript/module/lib/wagmi/WagmiEventHandler.d.ts.map +1 -0
  235. package/lib/typescript/module/lib/wagmi/index.d.ts +3 -0
  236. package/lib/typescript/module/lib/wagmi/index.d.ts.map +1 -0
  237. package/lib/typescript/module/lib/wagmi/types.d.ts +54 -0
  238. package/lib/typescript/module/lib/wagmi/types.d.ts.map +1 -0
  239. package/lib/typescript/module/package.json +1 -0
  240. package/lib/typescript/module/solana/address.d.ts +42 -0
  241. package/lib/typescript/module/solana/address.d.ts.map +1 -0
  242. package/lib/typescript/module/solana/index.d.ts +3 -0
  243. package/lib/typescript/module/solana/index.d.ts.map +1 -0
  244. package/lib/typescript/module/solana/types.d.ts +34 -0
  245. package/lib/typescript/module/solana/types.d.ts.map +1 -0
  246. package/lib/typescript/module/types/base.d.ts +258 -0
  247. package/lib/typescript/module/types/base.d.ts.map +1 -0
  248. package/lib/typescript/module/types/events.d.ts +111 -0
  249. package/lib/typescript/module/types/events.d.ts.map +1 -0
  250. package/lib/typescript/module/types/index.d.ts +3 -0
  251. package/lib/typescript/module/types/index.d.ts.map +1 -0
  252. package/lib/typescript/module/utils/address.d.ts +45 -0
  253. package/lib/typescript/module/utils/address.d.ts.map +1 -0
  254. package/lib/typescript/module/utils/hash.d.ts +18 -0
  255. package/lib/typescript/module/utils/hash.d.ts.map +1 -0
  256. package/lib/typescript/module/utils/helpers.d.ts +26 -0
  257. package/lib/typescript/module/utils/helpers.d.ts.map +1 -0
  258. package/lib/typescript/module/utils/index.d.ts +6 -0
  259. package/lib/typescript/module/utils/index.d.ts.map +1 -0
  260. package/lib/typescript/module/utils/timestamp.d.ts +13 -0
  261. package/lib/typescript/module/utils/timestamp.d.ts.map +1 -0
  262. package/lib/typescript/module/utils/trafficSource.d.ts +46 -0
  263. package/lib/typescript/module/utils/trafficSource.d.ts.map +1 -0
  264. package/lib/typescript/module/version.d.ts +2 -0
  265. package/lib/typescript/module/version.d.ts.map +1 -0
  266. package/package.json +44 -49
  267. package/src/FormoAnalytics.ts +118 -16
  268. package/src/constants/events.ts +4 -0
  269. package/src/constants/storage.ts +7 -0
  270. package/src/lib/event/EventFactory.ts +129 -29
  271. package/src/lib/event/EventQueue.ts +14 -0
  272. package/src/lib/event/types.ts +0 -1
  273. package/src/lib/installReferrer/index.ts +225 -0
  274. package/src/lib/lifecycle/index.ts +10 -1
  275. package/src/lib/wagmi/WagmiEventHandler.ts +0 -4
  276. package/src/solana/address.ts +122 -0
  277. package/src/solana/index.ts +2 -0
  278. package/src/solana/types.ts +46 -0
  279. package/src/types/base.ts +41 -1
  280. package/src/types/events.ts +1 -1
  281. package/src/utils/address.ts +72 -6
  282. package/src/utils/hash.ts +51 -6
  283. package/src/utils/trafficSource.ts +73 -0
  284. package/src/version.ts +1 -1
  285. package/lib/typescript/FormoAnalytics.d.ts.map +0 -1
  286. package/lib/typescript/FormoAnalyticsProvider.d.ts.map +0 -1
  287. package/lib/typescript/constants/config.d.ts.map +0 -1
  288. package/lib/typescript/constants/events.d.ts.map +0 -1
  289. package/lib/typescript/constants/index.d.ts.map +0 -1
  290. package/lib/typescript/constants/storage.d.ts.map +0 -1
  291. package/lib/typescript/index.d.ts.map +0 -1
  292. package/lib/typescript/lib/consent/index.d.ts.map +0 -1
  293. package/lib/typescript/lib/event/EventFactory.d.ts.map +0 -1
  294. package/lib/typescript/lib/event/EventManager.d.ts.map +0 -1
  295. package/lib/typescript/lib/event/EventQueue.d.ts.map +0 -1
  296. package/lib/typescript/lib/event/index.d.ts.map +0 -1
  297. package/lib/typescript/lib/event/types.d.ts.map +0 -1
  298. package/lib/typescript/lib/lifecycle/index.d.ts.map +0 -1
  299. package/lib/typescript/lib/logger/index.d.ts.map +0 -1
  300. package/lib/typescript/lib/session/index.d.ts.map +0 -1
  301. package/lib/typescript/lib/storage/AsyncStorageAdapter.d.ts.map +0 -1
  302. package/lib/typescript/lib/storage/MemoryStorage.d.ts.map +0 -1
  303. package/lib/typescript/lib/storage/StorageBlueprint.d.ts.map +0 -1
  304. package/lib/typescript/lib/storage/StorageManager.d.ts.map +0 -1
  305. package/lib/typescript/lib/storage/index.d.ts.map +0 -1
  306. package/lib/typescript/lib/storage/types.d.ts.map +0 -1
  307. package/lib/typescript/lib/wagmi/WagmiEventHandler.d.ts.map +0 -1
  308. package/lib/typescript/lib/wagmi/index.d.ts.map +0 -1
  309. package/lib/typescript/lib/wagmi/types.d.ts.map +0 -1
  310. package/lib/typescript/types/base.d.ts.map +0 -1
  311. package/lib/typescript/types/events.d.ts.map +0 -1
  312. package/lib/typescript/types/index.d.ts.map +0 -1
  313. package/lib/typescript/utils/address.d.ts +0 -25
  314. package/lib/typescript/utils/address.d.ts.map +0 -1
  315. package/lib/typescript/utils/hash.d.ts +0 -10
  316. package/lib/typescript/utils/hash.d.ts.map +0 -1
  317. package/lib/typescript/utils/helpers.d.ts.map +0 -1
  318. package/lib/typescript/utils/index.d.ts.map +0 -1
  319. package/lib/typescript/utils/timestamp.d.ts.map +0 -1
  320. package/lib/typescript/utils/trafficSource.d.ts.map +0 -1
  321. package/lib/typescript/version.d.ts +0 -2
  322. package/lib/typescript/version.d.ts.map +0 -1
  323. /package/lib/typescript/{FormoAnalyticsProvider.d.ts → commonjs/FormoAnalyticsProvider.d.ts} +0 -0
  324. /package/lib/typescript/{constants → commonjs/constants}/config.d.ts +0 -0
  325. /package/lib/typescript/{constants → commonjs/constants}/index.d.ts +0 -0
  326. /package/lib/typescript/{index.d.ts → commonjs/index.d.ts} +0 -0
  327. /package/lib/typescript/{lib → commonjs/lib}/consent/index.d.ts +0 -0
  328. /package/lib/typescript/{lib → commonjs/lib}/event/EventManager.d.ts +0 -0
  329. /package/lib/typescript/{lib → commonjs/lib}/event/EventQueue.d.ts +0 -0
  330. /package/lib/typescript/{lib → commonjs/lib}/event/index.d.ts +0 -0
  331. /package/lib/typescript/{lib → commonjs/lib}/lifecycle/index.d.ts +0 -0
  332. /package/lib/typescript/{lib → commonjs/lib}/logger/index.d.ts +0 -0
  333. /package/lib/typescript/{lib → commonjs/lib}/session/index.d.ts +0 -0
  334. /package/lib/typescript/{lib → commonjs/lib}/storage/AsyncStorageAdapter.d.ts +0 -0
  335. /package/lib/typescript/{lib → commonjs/lib}/storage/MemoryStorage.d.ts +0 -0
  336. /package/lib/typescript/{lib → commonjs/lib}/storage/StorageBlueprint.d.ts +0 -0
  337. /package/lib/typescript/{lib → commonjs/lib}/storage/StorageManager.d.ts +0 -0
  338. /package/lib/typescript/{lib → commonjs/lib}/storage/index.d.ts +0 -0
  339. /package/lib/typescript/{lib → commonjs/lib}/storage/types.d.ts +0 -0
  340. /package/lib/typescript/{lib → commonjs/lib}/wagmi/index.d.ts +0 -0
  341. /package/lib/typescript/{lib → commonjs/lib}/wagmi/types.d.ts +0 -0
  342. /package/lib/typescript/{types → commonjs/types}/index.d.ts +0 -0
  343. /package/lib/typescript/{utils → commonjs/utils}/helpers.d.ts +0 -0
  344. /package/lib/typescript/{utils → commonjs/utils}/index.d.ts +0 -0
  345. /package/lib/typescript/{utils → commonjs/utils}/timestamp.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AA6BD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAoBxE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GACjB,CAAC,CA2BH;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC1C,MAAM,CAQR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAiBtD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/utils/timestamp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAOnD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -27,4 +27,20 @@ export declare function clearTrafficSource(): void;
27
27
  * Stored traffic source is used as fallback - current context takes priority
28
28
  */
29
29
  export declare function mergeWithStoredTrafficSource(context?: Record<string, unknown>): Record<string, unknown>;
30
+ /**
31
+ * Update stored traffic source with incoming values. Per-field last-touch with
32
+ * fallback: non-empty incoming fields win, empty incoming fields preserve the
33
+ * previously stored value. This matches the Formo web SDK's behavior and
34
+ * prevents a non-marketing deep link (e.g. "myapp://home" with only a referrer
35
+ * and no UTM/ref) from destroying existing attribution data written by the
36
+ * Install Referrer flow or an earlier marketing deep link.
37
+ */
38
+ export declare function updateStoredTrafficSource(incoming: Partial<ITrafficSource>): void;
39
+ /**
40
+ * Merge a partial traffic source into the stored one, only filling in fields
41
+ * that are currently empty. Used by the Install Referrer flow so campaign data
42
+ * from the Play Store install referrer cannot clobber a deep-link attribution
43
+ * that arrived earlier in the same cold start.
44
+ */
45
+ export declare function mergeTrafficSourceFill(incoming: Partial<ITrafficSource>): void;
30
46
  //# sourceMappingURL=trafficSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trafficSource.d.ts","sourceRoot":"","sources":["../../../../src/utils/trafficSource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,eAAe,CAAC,EAAE,MAAM,EAAE,EAC1B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,CAAC,CA8DzB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAkB/E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAU5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAaD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,GAChC,IAAI,CAmBN;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,GAChC,IAAI,CAqBN"}
@@ -0,0 +1,2 @@
1
+ export declare const version = "1.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,182 @@
1
+ /**
2
+ * FormoAnalytics for React Native
3
+ *
4
+ * Main SDK class for tracking wallet events and user analytics in mobile dApps
5
+ */
6
+ import { AsyncStorageInterface } from "./lib/storage";
7
+ import { Address, ChainID, Config, IFormoAnalytics, IFormoEventContext, IFormoEventProperties, Options, SignatureStatus, TransactionStatus } from "./types";
8
+ export declare class FormoAnalytics implements IFormoAnalytics {
9
+ readonly writeKey: string;
10
+ options: Options;
11
+ private session;
12
+ private eventManager;
13
+ private eventQueue;
14
+ private wagmiHandler?;
15
+ private lifecycleManager?;
16
+ private linkingSubscription?;
17
+ config: Config;
18
+ currentChainId?: ChainID;
19
+ currentAddress?: Address;
20
+ currentUserId?: string;
21
+ private constructor();
22
+ /**
23
+ * Initialize the SDK
24
+ * @param writeKey - Your Formo write key
25
+ * @param options - Configuration options
26
+ * @param asyncStorage - AsyncStorage instance from @react-native-async-storage/async-storage
27
+ */
28
+ static init(writeKey: string, options?: Options, asyncStorage?: AsyncStorageInterface): Promise<FormoAnalytics>;
29
+ /**
30
+ * Hook into React Native's Linking API to auto-capture traffic source from
31
+ * the launch URL and any subsequent deep-link opens. Awaits the initial URL
32
+ * so attribution is in storage before the first lifecycle event fires.
33
+ */
34
+ private startDeepLinkCapture;
35
+ /**
36
+ * Track a screen view (mobile equivalent of page view)
37
+ */
38
+ screen(name: string, category?: string, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
39
+ /**
40
+ * Set traffic source from deep link URL
41
+ * Parses UTM parameters and referrer information from URL
42
+ * This is automatically persisted for the session
43
+ *
44
+ * @param url - Deep link URL (e.g., "myapp://product?utm_source=facebook&ref=friend123")
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * import { Linking } from 'react-native';
49
+ *
50
+ * // Listen for deep links
51
+ * Linking.addEventListener('url', (event) => {
52
+ * formo.setTrafficSourceFromUrl(event.url);
53
+ * });
54
+ *
55
+ * // Or get initial URL
56
+ * Linking.getInitialURL().then((url) => {
57
+ * if (url) formo.setTrafficSourceFromUrl(url);
58
+ * });
59
+ * ```
60
+ */
61
+ setTrafficSourceFromUrl(url: string): void;
62
+ /**
63
+ * Reset the current user session
64
+ */
65
+ reset(): void;
66
+ /**
67
+ * Clean up resources
68
+ */
69
+ cleanup(): Promise<void>;
70
+ /**
71
+ * Track wallet connect event
72
+ */
73
+ connect({ chainId, address }: {
74
+ chainId: ChainID;
75
+ address: Address;
76
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
77
+ /**
78
+ * Track wallet disconnect event
79
+ */
80
+ disconnect(params?: {
81
+ chainId?: ChainID;
82
+ address?: Address;
83
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
84
+ /**
85
+ * Track chain change event
86
+ */
87
+ chain({ chainId, address }: {
88
+ chainId: ChainID;
89
+ address?: Address;
90
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
91
+ /**
92
+ * Track signature event
93
+ */
94
+ signature({ status, chainId, address, message, }: {
95
+ status: SignatureStatus;
96
+ chainId?: ChainID;
97
+ address: Address;
98
+ message: string;
99
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
100
+ /**
101
+ * Track transaction event
102
+ */
103
+ transaction({ status, chainId, address, data, to, value, transactionHash, function_name, function_args, }: {
104
+ status: TransactionStatus;
105
+ chainId: ChainID;
106
+ address: Address;
107
+ data?: string;
108
+ to?: string;
109
+ value?: string;
110
+ transactionHash?: string;
111
+ function_name?: string;
112
+ function_args?: Record<string, unknown>;
113
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
114
+ /**
115
+ * Track identify event
116
+ */
117
+ identify(params: {
118
+ address: Address;
119
+ providerName?: string;
120
+ userId?: string;
121
+ rdns?: string;
122
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
123
+ /**
124
+ * Track detect wallet event
125
+ */
126
+ detect({ providerName, rdns }: {
127
+ providerName: string;
128
+ rdns: string;
129
+ }, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
130
+ /**
131
+ * Track custom event
132
+ */
133
+ track(event: string, properties?: IFormoEventProperties, context?: IFormoEventContext, callback?: (...args: unknown[]) => void): Promise<void>;
134
+ /**
135
+ * Opt out of tracking
136
+ */
137
+ optOutTracking(): void;
138
+ /**
139
+ * Opt back into tracking
140
+ */
141
+ optInTracking(): void;
142
+ /**
143
+ * Check if user has opted out
144
+ */
145
+ hasOptedOutTracking(): boolean;
146
+ /**
147
+ * Check if autocapture is enabled for a given event type.
148
+ * Applies only to event-generating behaviors (wallet events, lifecycle
149
+ * events). Attribution is controlled separately via `options.attribution`
150
+ * because it enriches events rather than generating them.
151
+ */
152
+ isAutocaptureEnabled(eventType: "connect" | "disconnect" | "signature" | "transaction" | "chain" | "lifecycle"): boolean;
153
+ /**
154
+ * Check if an attribution source is enabled. Attribution is not an event
155
+ * type — it decorates every tracked event with `utm_*`, `ref`, and
156
+ * `referrer` context fields.
157
+ */
158
+ isAttributionEnabled(source: "deeplinks" | "installReferrer"): boolean;
159
+ /**
160
+ * Internal method to track events
161
+ * This is the single enforcement point for shouldTrack() - all public tracking
162
+ * methods (track, screen, connect, etc.) route through here
163
+ */
164
+ private trackEvent;
165
+ /**
166
+ * Check if tracking should be enabled
167
+ */
168
+ private shouldTrack;
169
+ /**
170
+ * Validate and normalize an address for the given chain.
171
+ *
172
+ * EVM addresses are returned in EIP-55 checksum format.
173
+ * Solana addresses are returned as-is (Base58 is case-sensitive).
174
+ * When chainId is omitted, EVM is tried first with Solana as fallback.
175
+ */
176
+ private validateAndChecksumAddress;
177
+ /**
178
+ * Flush pending events
179
+ */
180
+ flush(): Promise<void>;
181
+ }
182
+ //# sourceMappingURL=FormoAnalytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormoAnalytics.d.ts","sourceRoot":"","sources":["../../../src/FormoAnalytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAA+B,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAWnF,OAAO,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,eAAe,EAEf,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAMjB,qBAAa,cAAe,YAAW,eAAe;aAclC,QAAQ,EAAE,MAAM;IACzB,OAAO,EAAE,OAAO;IAdzB,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAoB;IACzC,OAAO,CAAC,gBAAgB,CAAC,CAAsB;IAC/C,OAAO,CAAC,mBAAmB,CAAC,CAAsB;IAElD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAM;IAE5B,OAAO;IA0DP;;;;;OAKG;WACU,IAAI,CACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,EACjB,YAAY,CAAC,EAAE,qBAAqB,GACnC,OAAO,CAAC,cAAc,CAAC;IAyD1B;;;;OAIG;Y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AOlC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
@@ -0,0 +1,29 @@
1
+ import React, { FC } from "react";
2
+ import { FormoAnalyticsProviderProps, IFormoAnalytics } from "./types";
3
+ export declare const FormoAnalyticsContext: React.Context<IFormoAnalytics>;
4
+ /**
5
+ * Formo Analytics Provider for React Native
6
+ *
7
+ * Wraps your app to provide analytics context
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import AsyncStorage from '@react-native-async-storage/async-storage';
12
+ * import { FormoAnalyticsProvider } from '@formo/analytics-react-native';
13
+ *
14
+ * function App() {
15
+ * return (
16
+ * <FormoAnalyticsProvider
17
+ * writeKey="your-write-key"
18
+ * asyncStorage={AsyncStorage}
19
+ * options={{ wagmi: { config, queryClient } }}
20
+ * >
21
+ * <YourApp />
22
+ * </FormoAnalyticsProvider>
23
+ * );
24
+ * }
25
+ * ```
26
+ */
27
+ export declare const FormoAnalyticsProvider: FC<FormoAnalyticsProviderProps>;
28
+ export declare const useFormo: () => IFormoAnalytics;
29
+ //# sourceMappingURL=FormoAnalyticsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormoAnalyticsProvider.d.ts","sourceRoot":"","sources":["../../../src/FormoAnalyticsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,EAAE,EACH,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAsBvE,eAAO,MAAM,qBAAqB,gCACc,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAwBlE,CAAC;AAgMF,eAAO,MAAM,QAAQ,QAAO,eAmB3B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const EVENTS_API_ORIGIN = "https://events.formo.so";
2
+ export declare const EVENTS_API_HOST = "https://events.formo.so/v0/raw_events";
3
+ export declare const EVENTS_API_REQUEST_HEADER: (writeKey: string) => {
4
+ "Content-Type": string;
5
+ Authorization: string;
6
+ };
7
+ export declare const COUNTRY_LIST: Record<string, string>;
8
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/constants/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAC3D,eAAO,MAAM,eAAe,0CAAuC,CAAC;AAEpE,eAAO,MAAM,yBAAyB,GAAI,UAAU,MAAM;;;CAGxD,CAAC;AAGH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoD/C,CAAC"}
@@ -0,0 +1,24 @@
1
+ export declare enum EventType {
2
+ PAGE = "page",
3
+ SCREEN = "screen",
4
+ IDENTIFY = "identify",
5
+ DETECT = "detect",
6
+ CONNECT = "connect",
7
+ DISCONNECT = "disconnect",
8
+ CHAIN = "chain",
9
+ SIGNATURE = "signature",
10
+ TRANSACTION = "transaction",
11
+ TRACK = "track"
12
+ }
13
+ export declare enum EventChannel {
14
+ WEB = "web",
15
+ MOBILE = "mobile",
16
+ SERVER = "server",
17
+ SOURCE = "source"
18
+ }
19
+ export type TEventType = Lowercase<EventType>;
20
+ export type TEventChannel = Lowercase<EventChannel>;
21
+ export declare const CHANNEL: TEventChannel;
22
+ export declare const VERSION = "0";
23
+ export declare const SESSION_TIMEOUT_MS: number;
24
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/constants/events.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,oBAAY,YAAY;IACtB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAGpD,eAAO,MAAM,OAAO,EAAE,aAAwB,CAAC;AAC/C,eAAO,MAAM,OAAO,MAAM,CAAC;AAI3B,eAAO,MAAM,kBAAkB,QAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./events";
2
+ export * from "./config";
3
+ export * from "./storage";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const STORAGE_PREFIX = "formo_rn_";
2
+ export declare const LOCAL_ANONYMOUS_ID_KEY = "anonymous_id";
3
+ export declare const LOCAL_APP_VERSION_KEY = "app_version";
4
+ export declare const LOCAL_APP_BUILD_KEY = "app_build";
5
+ export declare const LOCAL_SESSION_ID_KEY = "session_id";
6
+ export declare const LOCAL_SESSION_LAST_ACTIVITY_KEY = "session_last_activity";
7
+ export declare const LOCAL_INSTALL_REFERRER_RESOLVED_KEY = "install_referrer_resolved";
8
+ export declare const SESSION_USER_ID_KEY = "user_id";
9
+ export declare const SESSION_TRAFFIC_SOURCE_KEY = "traffic_source";
10
+ export declare const SESSION_WALLET_DETECTED_KEY = "wallet_detected";
11
+ export declare const SESSION_WALLET_IDENTIFIED_KEY = "wallet_identified";
12
+ export declare const CONSENT_OPT_OUT_KEY = "opt_out_tracking";
13
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/constants/storage.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,cAAc,CAAC;AAG1C,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAG/C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AAGvE,eAAO,MAAM,mCAAmC,8BAA8B,CAAC;AAG/E,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAGjE,eAAO,MAAM,mBAAmB,qBAAqB,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Formo Analytics SDK for React Native
3
+ *
4
+ * Track wallet events and user analytics in mobile dApps
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * import AsyncStorage from '@react-native-async-storage/async-storage';
9
+ * import { FormoAnalyticsProvider, useFormo } from '@formo/analytics-react-native';
10
+ *
11
+ * // Wrap your app with the provider
12
+ * function App() {
13
+ * return (
14
+ * <FormoAnalyticsProvider
15
+ * writeKey="your-write-key"
16
+ * asyncStorage={AsyncStorage}
17
+ * options={{
18
+ * wagmi: { config, queryClient },
19
+ * app: { name: 'MyApp', version: '1.0.0' },
20
+ * }}
21
+ * >
22
+ * <YourApp />
23
+ * </FormoAnalyticsProvider>
24
+ * );
25
+ * }
26
+ *
27
+ * // Use the hook in your components
28
+ * function MyScreen() {
29
+ * const formo = useFormo();
30
+ *
31
+ * useEffect(() => {
32
+ * formo.screen('Home');
33
+ * }, []);
34
+ *
35
+ * return <View>...</View>;
36
+ * }
37
+ * ```
38
+ */
39
+ export { FormoAnalytics } from "./FormoAnalytics";
40
+ export { FormoAnalyticsProvider, FormoAnalyticsContext, useFormo, } from "./FormoAnalyticsProvider";
41
+ export * from "./types";
42
+ export { SignatureStatus, TransactionStatus } from "./types/events";
43
+ export type { AsyncStorageInterface } from "./lib/storage";
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAGlC,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Set a consent flag
3
+ */
4
+ export declare function setConsentFlag(writeKey: string, key: string, value: string): void;
5
+ /**
6
+ * Get a consent flag
7
+ */
8
+ export declare function getConsentFlag(writeKey: string, key: string): string | null;
9
+ /**
10
+ * Remove a consent flag
11
+ */
12
+ export declare function removeConsentFlag(writeKey: string, key: string): void;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/consent/index.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,IAAI,CAON;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ3E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAOrE"}
@@ -0,0 +1,99 @@
1
+ import { Address, APIEvent, ChainID, IFormoEvent, IFormoEventContext, IFormoEventProperties, Nullable, Options, SignatureStatus, TransactionStatus } from "../../types";
2
+ import { IEventFactory } from "./types";
3
+ /**
4
+ * Get the current session id, or start a new one.
5
+ *
6
+ * A session persists across app restarts but expires after SESSION_TIMEOUT_MS of
7
+ * inactivity, at which point a fresh id is minted. Every call refreshes the
8
+ * last-activity marker.
9
+ *
10
+ * The mobile SDK owns its session_id rather than letting ingestion derive one.
11
+ * The events-gateway authorizer computes
12
+ * `hash(dailySalt + domain + sourceIp + userAgent)` — a design built for the
13
+ * web, where all three inputs carry real entropy. For a native app they all
14
+ * degenerate at once: there is no Origin header (so `domain` is the constant
15
+ * "unknown"), the HTTP User-Agent is the client library's (`okhttp/…`,
16
+ * `CFNetwork/… Darwin/…`) and is near-identical across users on the same app
17
+ * build, and carrier CGNAT puts many users behind one IP — so unrelated users
18
+ * collapse into a single session. Ingestion honours a body-provided session_id
19
+ * (`obj?.session_id || session_id` in handlerV0), which is the path used here.
20
+ */
21
+ export declare function getSessionId(): string;
22
+ /**
23
+ * Build a representative User-Agent string from structured device info.
24
+ *
25
+ * The ingestion pipeline classifies device / os / browser purely from the
26
+ * user_agent string; a mobile event with an empty UA is bucketed as "unknown".
27
+ * Platforms without a native UA (e.g. Expo, where DeviceInfo.getUserAgent() is
28
+ * unavailable) would otherwise report device=os=unknown. We synthesize a UA
29
+ * containing the tokens the classifier keys off (iphone/ipad/android + version)
30
+ * so mobile device and OS resolve correctly. Returns "" for unknown platforms.
31
+ */
32
+ export declare function synthesizeUserAgent(info: {
33
+ os_name: string;
34
+ os_version: string;
35
+ device_model: string;
36
+ device_type: string;
37
+ }): string;
38
+ /**
39
+ * Event factory for React Native
40
+ * Creates event payloads with mobile-specific context
41
+ */
42
+ declare class EventFactory implements IEventFactory {
43
+ private options?;
44
+ constructor(options?: Options);
45
+ /**
46
+ * Get device timezone
47
+ */
48
+ private getTimezone;
49
+ /**
50
+ * Get location from timezone
51
+ */
52
+ private getLocation;
53
+ /**
54
+ * Get device language/locale
55
+ */
56
+ private getLanguage;
57
+ /**
58
+ * Get screen dimensions
59
+ */
60
+ private getScreen;
61
+ /**
62
+ * Get network information
63
+ */
64
+ private getNetworkInfo;
65
+ /**
66
+ * Get device information
67
+ * Supports both react-native-device-info (bare RN) and expo-device/expo-application (Expo Go)
68
+ */
69
+ private getDeviceInfo;
70
+ /**
71
+ * Generate context with mobile-specific metadata
72
+ */
73
+ private generateContext;
74
+ /**
75
+ * Create enriched event with common properties
76
+ */
77
+ private getEnrichedEvent;
78
+ /**
79
+ * Generate screen view event as a page event for unified analytics.
80
+ * Maps screen name to page-equivalent context fields (page_title, page_path, page_url)
81
+ * so Tinybird materializations (process_sessions, process_sources) can process mobile
82
+ * screen views alongside web page views. The channel="mobile" distinguishes the source.
83
+ */
84
+ generateScreenEvent(name: string, category?: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
85
+ generateDetectWalletEvent(providerName: string, rdns: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
86
+ generateIdentifyEvent(providerName: string, rdns: string, address: Nullable<Address>, userId?: Nullable<string>, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
87
+ generateConnectEvent(chainId: ChainID, address: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
88
+ generateDisconnectEvent(chainId?: ChainID, address?: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
89
+ generateChainChangedEvent(chainId: ChainID, address: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
90
+ generateSignatureEvent(status: SignatureStatus, chainId: ChainID | undefined, address: Address, message: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
91
+ generateTransactionEvent(status: TransactionStatus, chainId: ChainID, address: Address, data?: string, to?: string, value?: string, transactionHash?: string, function_name?: string, function_args?: Record<string, unknown>, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
92
+ generateTrackEvent(event: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise<IFormoEvent>;
93
+ /**
94
+ * Create event from API event type
95
+ */
96
+ create(event: APIEvent, address?: Address, userId?: string): Promise<IFormoEvent>;
97
+ }
98
+ export { EventFactory };
99
+ //# sourceMappingURL=EventFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventFactory.d.ts","sourceRoot":"","sources":["../../../../../src/lib/event/EventFactory.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,eAAe,EACf,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAWrB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBxC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAcrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAgBT;AAED;;;GAGG;AACH,cAAM,YAAa,YAAW,aAAa;IACzC,OAAO,CAAC,OAAO,CAAC,CAAU;gBAEd,OAAO,CAAC,EAAE,OAAO;IAI7B;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAanB;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB;;OAEG;IACH,OAAO,CAAC,SAAS;IAsBjB;;OAEG;YACW,cAAc;IAuC5B;;;OAGG;YACW,aAAa;IA6G3B;;OAEG;YACW,eAAe;IAuC7B;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AM,EACf,UAAU,CAAC,EAAE,qBAAqB,EAClC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAejB,wBAAwB,CAC5B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,MAAM,EACb,EAAE,CAAC,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,UAAU,CAAC,EAAE,qBAAqB,EAClC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAoBjB,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,qBAAqB,EAClC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAyBvB;;OAEG;IACG,MAAM,CACV,KAAK,EAAE,QAAQ,EACf,OAAO,CAAC,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC;CAiGxB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Address, APIEvent, Options } from "../../types";
2
+ import { IEventFactory, IEventManager, IEventQueue } from "./types";
3
+ /**
4
+ * Event manager for React Native SDK
5
+ * Generates valid event payloads and queues them for processing
6
+ */
7
+ declare class EventManager implements IEventManager {
8
+ eventQueue: IEventQueue;
9
+ eventFactory: IEventFactory;
10
+ constructor(eventQueue: IEventQueue, options?: Options);
11
+ /**
12
+ * Add event to queue
13
+ */
14
+ addEvent(event: APIEvent, address?: Address, userId?: string): Promise<void>;
15
+ }
16
+ export { EventManager };
17
+ //# sourceMappingURL=EventManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventManager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/event/EventManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGpE;;;GAGG;AACH,cAAM,YAAa,YAAW,aAAa;IACzC,UAAU,EAAE,WAAW,CAAC;IACxB,YAAY,EAAE,aAAa,CAAC;gBAEhB,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO;IAKtD;;OAEG;IACG,QAAQ,CACZ,KAAK,EAAE,QAAQ,EACf,OAAO,CAAC,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;CAqBjB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { IFormoEvent } from "../../types";
2
+ import { IEventQueue } from "./types";
3
+ interface Options {
4
+ apiHost: string;
5
+ flushAt?: number;
6
+ flushInterval?: number;
7
+ retryCount?: number;
8
+ maxQueueSize?: number;
9
+ }
10
+ /**
11
+ * Event queue for React Native
12
+ * Handles batching, flushing, and retries with app lifecycle awareness
13
+ */
14
+ export declare class EventQueue implements IEventQueue {
15
+ private writeKey;
16
+ private apiHost;
17
+ private queue;
18
+ private timer;
19
+ private flushAt;
20
+ private flushIntervalMs;
21
+ private maxQueueSize;
22
+ private retryCount;
23
+ private payloadHashes;
24
+ private flushMutex;
25
+ private appStateSubscription;
26
+ constructor(writeKey: string, options: Options);
27
+ /**
28
+ * Set up listener for app state changes
29
+ * Flush events when app goes to background
30
+ */
31
+ private setupAppStateListener;
32
+ /**
33
+ * Handle app state changes
34
+ */
35
+ private handleAppStateChange;
36
+ /**
37
+ * Generate message ID for deduplication
38
+ */
39
+ private generateMessageId;
40
+ /**
41
+ * Check if event is a duplicate
42
+ */
43
+ private isDuplicate;
44
+ /**
45
+ * Add event to queue
46
+ */
47
+ enqueue(event: IFormoEvent, callback?: (...args: unknown[]) => void): Promise<void>;
48
+ /**
49
+ * Flush events to API
50
+ * Uses a mutex to ensure only one flush operation runs at a time,
51
+ * preventing race conditions with re-queued items on failure.
52
+ */
53
+ flush(callback?: (...args: unknown[]) => void): Promise<void>;
54
+ /**
55
+ * Send events with retry logic
56
+ */
57
+ private sendWithRetry;
58
+ /**
59
+ * Check if error should be retried
60
+ */
61
+ private shouldRetry;
62
+ /**
63
+ * Discard all pending events without sending them.
64
+ * Used when the user opts out of tracking to prevent queued events
65
+ * from being sent after consent is revoked.
66
+ */
67
+ clear(): void;
68
+ /**
69
+ * Clean up resources, flushing any pending events first
70
+ */
71
+ cleanup(): Promise<void>;
72
+ }
73
+ export {};
74
+ //# sourceMappingURL=EventQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventQueue.d.ts","sourceRoot":"","sources":["../../../../../src/lib/event/EventQueue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAW9D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAYtC,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoBD;;;GAGG;AACH,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,oBAAoB,CAAuC;gBAEvD,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IA2B9C;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;YACW,iBAAiB;IAS/B;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACG,OAAO,CACX,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GACtC,OAAO,CAAC,IAAI,CAAC;IAgEhB;;;;OAIG;IACG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA2DnE;;OAEG;YACW,aAAa;IA+B3B;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;;;OAIG;IACI,KAAK,IAAI,IAAI;IAYpB;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAiDtC"}
@@ -0,0 +1,5 @@
1
+ export * from "./EventFactory";
2
+ export * from "./EventManager";
3
+ export * from "./EventQueue";
4
+ export * from "./types";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}