@walkeros/web-source-browser 0.4.2 → 0.5.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <p align="left">
2
- <a href="https://elbwalker.com">
3
- <img title="elbwalker" src='https://www.elbwalker.com/img/elbwalker_logo.png' width="256px"/>
2
+ <a href="https://www.walkeros.io">
3
+ <img title="elbwalker" src='https://www.walkeros.io/img/elbwalker_logo.png' width="256px"/>
4
4
  </a>
5
5
  </p>
6
6
 
@@ -12,6 +12,17 @@
12
12
  The Browser Source is walkerOS's primary web tracking solution that you can use
13
13
  to capture user interactions directly from the browsers DOM.
14
14
 
15
+ ## Quick Start
16
+
17
+ ```bash
18
+ npm install @walkeros/web-source-browser
19
+ ```
20
+
21
+ ```typescript
22
+ import { sourceBrowser } from '@walkeros/web-source-browser';
23
+ await startFlow({ sources: { browser: { code: sourceBrowser } } });
24
+ ```
25
+
15
26
  ## What It Does
16
27
 
17
28
  The Browser Source transforms your website into a comprehensive tracking
@@ -35,18 +46,20 @@ Setup in your project:
35
46
 
36
47
  ```javascript
37
48
  import { startFlow } from '@walkeros/collector';
38
- import { createSource } from '@walkeros/core';
39
49
  import { sourceBrowser } from '@walkeros/web-source-browser';
40
50
 
41
51
  const { collector } = await startFlow({
42
52
  sources: {
43
- browser: createSource(sourceBrowser, {
44
- settings: {
45
- pageview: true,
46
- session: true,
47
- elb: 'elb', // Browser source will set window.elb automatically
53
+ browser: {
54
+ code: sourceBrowser,
55
+ config: {
56
+ settings: {
57
+ pageview: true,
58
+ session: true,
59
+ elb: 'elb', // Browser source will set window.elb automatically
60
+ },
48
61
  },
49
- }),
62
+ },
50
63
  },
51
64
  });
52
65
  ```
@@ -57,26 +70,26 @@ Load the source via dynamic import:
57
70
 
58
71
  ```html
59
72
  <script>
60
- // Load the collector, core utilities, and source
73
+ // Load the collector and source
61
74
  const { startFlow } = await import(
62
75
  'https://cdn.jsdelivr.net/npm/@walkeros/collector/dist/index.mjs'
63
76
  );
64
- const { createSource } = await import(
65
- 'https://cdn.jsdelivr.net/npm/@walkeros/core/dist/index.mjs'
66
- );
67
77
  const { sourceBrowser } = await import(
68
78
  'https://cdn.jsdelivr.net/npm/@walkeros/web-source-browser/dist/index.mjs'
69
79
  );
70
80
 
71
81
  const { collector, elb } = await startFlow({
72
82
  sources: {
73
- browser: createSource(sourceBrowser, {
74
- settings: {
75
- prefix: 'data-elb',
76
- pageview: true,
77
- session: true,
83
+ browser: {
84
+ code: sourceBrowser,
85
+ config: {
86
+ settings: {
87
+ prefix: 'data-elb',
88
+ pageview: true,
89
+ session: true,
90
+ },
78
91
  },
79
- }),
92
+ },
80
93
  },
81
94
  });
82
95
  </script>
@@ -102,8 +115,8 @@ Load the source via dynamic import:
102
115
  >
103
116
  > 1. **Collector elb** (`elb` from `startFlow`): Basic event tracking that
104
117
  > works with all sources and destinations
105
- > 2. **Browser Source elb** (`collector.sources.browser.elb` or direct from
106
- > `createSource`): Enhanced function with browser-specific features
118
+ > 2. **Browser Source elb** (`collector.sources.browser.elb`): Enhanced
119
+ > function with browser-specific features
107
120
  >
108
121
  > **Browser Source elb adds:**
109
122
  >
@@ -112,11 +125,10 @@ Load the source via dynamic import:
112
125
  > - **elbLayer Integration**: Automatic processing of queued commands
113
126
  > - **Element parameters**: Support for element parameters in DOM commands
114
127
  >
115
- > Use **separate source creation** for direct access to the enhanced elb
116
- > function, or access it via `collector.sources.browser.elb` in the unified API.
128
+ > Access the enhanced elb via `collector.sources.browser.elb`.
117
129
  >
118
- > See [Commands](https://www.elbwalker.com/docs/sources/web/browser/commands)
119
- > for full browser source API documentation.
130
+ > See [Commands](https://www.walkeros.io/docs/sources/web/browser/commands) for
131
+ > full browser source API documentation.
120
132
 
121
133
  ## Contribute
122
134