core-outline 1.1.18 → 1.1.20

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 ADDED
@@ -0,0 +1,50 @@
1
+ # CoreOutline React Component
2
+
3
+ A React component for integrating Core&Outline session recording and event tracking into your web application.
4
+
5
+ ## Installation
6
+
7
+ Install the package using npm:
8
+
9
+ ```sh
10
+ npm install core-outline
11
+
12
+
13
+ or using yarn:
14
+
15
+ ```sh
16
+ yarn install core-outline
17
+
18
+
19
+ ```sh
20
+ import React from 'react';
21
+ import CoreOutline from 'core-outline';
22
+
23
+ function App() {
24
+ return (
25
+ <CoreOutline
26
+ data_source_id={{ YOUR_DATA_SOURCE_ID }}
27
+ data_source_secret={{ YOUR_DATA_SOURCE_SECRET }}>
28
+ {/* Your app components */}
29
+ </CoreOutline>
30
+ );
31
+ }
32
+
33
+ export default App;
34
+
35
+
36
+ To flag items clicked or purchased:
37
+
38
+ ```sh
39
+ import { flag_item_clicked, flag_item_purchased } from 'core-outline;
40
+
41
+ To flag items clicked:
42
+
43
+ ```sh
44
+ flag_item_clicked('ITEM_ID');
45
+
46
+ To flag items purchased:
47
+
48
+ ```sh
49
+ flag_item_purchased('ITEM_ID');
50
+
package/dist/index.es.js CHANGED
@@ -6423,8 +6423,8 @@ var CoreOutline = function CoreOutline(_ref) {
6423
6423
  return _authorizeApp.apply(this, arguments);
6424
6424
  }
6425
6425
  var offLoadFunctionality = function offLoadFunctionality() {
6426
- var formattedEvents = events && events.length > 0 ? events : JSON.parse(localStorage.getItem('coreoutlineFormattedEvents') || '[]');
6427
- var rawEvents = replayEvents && replayEvents.length > 0 ? replayEvents : JSON.parse(localStorage.getItem('coreoutlineRawEvents') || '[]');
6426
+ var formattedEvents = events;
6427
+ var rawEvents = replayEvents;
6428
6428
  var data = JSON.stringify({
6429
6429
  data_source_id: data_source_id,
6430
6430
  sessionId: sessionId,
package/dist/index.js CHANGED
@@ -6431,8 +6431,8 @@ var CoreOutline = function CoreOutline(_ref) {
6431
6431
  return _authorizeApp.apply(this, arguments);
6432
6432
  }
6433
6433
  var offLoadFunctionality = function offLoadFunctionality() {
6434
- var formattedEvents = events && events.length > 0 ? events : JSON.parse(localStorage.getItem('coreoutlineFormattedEvents') || '[]');
6435
- var rawEvents = replayEvents && replayEvents.length > 0 ? replayEvents : JSON.parse(localStorage.getItem('coreoutlineRawEvents') || '[]');
6434
+ var formattedEvents = events;
6435
+ var rawEvents = replayEvents;
6436
6436
  var data = JSON.stringify({
6437
6437
  data_source_id: data_source_id,
6438
6438
  sessionId: sessionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-outline",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "A React component for Core&Outline",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -48,17 +48,8 @@ const CoreOutline = ({ children, data_source_id, data_source_secret }) => {
48
48
  }
49
49
 
50
50
  const offLoadFunctionality = () => {
51
- const formattedEvents =
52
- events && events.length > 0
53
- ? events
54
- : JSON.parse(
55
- localStorage.getItem('coreoutlineFormattedEvents') || '[]'
56
- );
57
- const rawEvents =
58
- replayEvents && replayEvents.length > 0
59
- ? replayEvents
60
- : JSON.parse(localStorage.getItem('coreoutlineRawEvents') || '[]');
61
-
51
+ const formattedEvents = events;
52
+ const rawEvents = replayEvents;
62
53
  const data = JSON.stringify({
63
54
  data_source_id: data_source_id,
64
55
  sessionId: sessionId,