@findsignal/recorder 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +29 -2
- package/THIRD-PARTY-NOTICES.md +429 -0
- package/dist/backoff.d.ts +19 -0
- package/dist/config.d.ts +57 -0
- package/dist/consent.d.ts +23 -0
- package/dist/events.d.ts +36 -0
- package/dist/field-facts.d.ts +30 -0
- package/dist/guards.d.ts +46 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +1351 -0
- package/dist/layout-facts.d.ts +69 -0
- package/dist/proxy.d.ts +31 -0
- package/dist/settings.d.ts +131 -0
- package/dist/signal-recorder.js +111 -0
- package/dist/switch-off.d.ts +26 -0
- package/package.json +55 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2026 John Fazio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @findsignal/recorder
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Signal's session recorder for your app. It records how people use it (page views, clicks, rage and dead clicks, errors, web vitals, network timing, the shape of what people type and the validation messages they see, a sample of the page's sizes and colours (never its text), and a replay of each session), masked by default, and sends it to Signal so Signal can find what's going wrong. (Signal is the new name of Aura, so the setup command is still `npx getaura` and the dashboard still says Aura for now.) It is built on [posthog-js](https://github.com/PostHog/posthog-js), pinned to one exact version.
|
|
4
|
+
|
|
5
|
+
**Nothing is recorded or sent, not even a request, until each person using your app agrees.** Call `optIn()` from your consent banner, when the person says yes.
|
|
6
|
+
The recorder then marks that yes in the replay (`aura_opt_in`, with a kind and a time only), so Signal can tell which trackers ran before it.
|
|
7
|
+
When your consent tool passes on a yes the person gave on an earlier visit (Cookiebot and OneTrust do, on every page), call `optIn({ earlier: true })` instead, so it isn't taken for a new one.
|
|
8
|
+
|
|
9
|
+
Easiest: run `npx getaura` in your repo and it adds the recorder for you. By hand, with a bundler:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @findsignal/recorder
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { init, optIn } from '@findsignal/recorder';
|
|
17
|
+
|
|
18
|
+
init({ key: 'arp_…' }); // your project's recorder key, from Settings in your dashboard
|
|
19
|
+
optIn(); // when the person agrees to be recorded
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Without a bundler, add the script tag to your layout:
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@findsignal/recorder@0.1/dist/signal-recorder.js" data-key="arp_…"></script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Every option, what is masked and kept, and how to send through your own domain: [the recorder's docs](https://github.com/Aura-Factory/aura/blob/main/docs/how-it-works/recorder.md).
|
|
29
|
+
|
|
30
|
+
MIT. posthog-js's own license (Apache-2.0 and MIT) is in `THIRD-PARTY-NOTICES.md`.
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
`@findsignal/recorder` depends on posthog-js, and its script-tag build (`dist/signal-recorder.js`) bundles posthog-js code. posthog-js keeps its own license, reproduced here in full as it requires.
|
|
4
|
+
|
|
5
|
+
## posthog-js 1.438.7
|
|
6
|
+
|
|
7
|
+
https://github.com/PostHog/posthog-js
|
|
8
|
+
|
|
9
|
+
License: Apache-2.0 AND MIT (its package.json). Its LICENSE file follows, including the MIT notices for the code it carries from others.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Copyright 2020 Posthog / Hiberly, Inc.
|
|
13
|
+
|
|
14
|
+
Copyright 2015 Mixpanel, Inc.
|
|
15
|
+
|
|
16
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
you may not use this work except in compliance with the License.
|
|
18
|
+
You may obtain a copy of the License below, or at:
|
|
19
|
+
|
|
20
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
|
|
22
|
+
Unless required by applicable law or agreed to in writing, software
|
|
23
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
24
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
25
|
+
See the License for the specific language governing permissions and
|
|
26
|
+
limitations under the License.
|
|
27
|
+
|
|
28
|
+
Apache License
|
|
29
|
+
Version 2.0, January 2004
|
|
30
|
+
http://www.apache.org/licenses/
|
|
31
|
+
|
|
32
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
33
|
+
|
|
34
|
+
1. Definitions.
|
|
35
|
+
|
|
36
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
37
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
38
|
+
|
|
39
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
40
|
+
the copyright owner that is granting the License.
|
|
41
|
+
|
|
42
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
43
|
+
other entities that control, are controlled by, or are under common
|
|
44
|
+
control with that entity. For the purposes of this definition,
|
|
45
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
46
|
+
direction or management of such entity, whether by contract or
|
|
47
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
48
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
49
|
+
|
|
50
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
51
|
+
exercising permissions granted by this License.
|
|
52
|
+
|
|
53
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
54
|
+
including but not limited to software source code, documentation
|
|
55
|
+
source, and configuration files.
|
|
56
|
+
|
|
57
|
+
"Object" form shall mean any form resulting from mechanical
|
|
58
|
+
transformation or translation of a Source form, including but
|
|
59
|
+
not limited to compiled object code, generated documentation,
|
|
60
|
+
and conversions to other media types.
|
|
61
|
+
|
|
62
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
63
|
+
Object form, made available under the License, as indicated by a
|
|
64
|
+
copyright notice that is included in or attached to the work
|
|
65
|
+
(an example is provided in the Appendix below).
|
|
66
|
+
|
|
67
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
68
|
+
form, that is based on (or derived from) the Work and for which the
|
|
69
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
70
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
71
|
+
of this License, Derivative Works shall not include works that remain
|
|
72
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
73
|
+
the Work and Derivative Works thereof.
|
|
74
|
+
|
|
75
|
+
"Contribution" shall mean any work of authorship, including
|
|
76
|
+
the original version of the Work and any modifications or additions
|
|
77
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
78
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
79
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
80
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
81
|
+
means any form of electronic, verbal, or written communication sent
|
|
82
|
+
to the Licensor or its representatives, including but not limited to
|
|
83
|
+
communication on electronic mailing lists, source code control systems,
|
|
84
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
85
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
86
|
+
excluding communication that is conspicuously marked or otherwise
|
|
87
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
88
|
+
|
|
89
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
90
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
91
|
+
subsequently incorporated within the Work.
|
|
92
|
+
|
|
93
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
94
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
95
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
96
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
97
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
98
|
+
Work and such Derivative Works in Source or Object form.
|
|
99
|
+
|
|
100
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
101
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
102
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
103
|
+
(except as stated in this section) patent license to make, have made,
|
|
104
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
105
|
+
where such license applies only to those patent claims licensable
|
|
106
|
+
by such Contributor that are necessarily infringed by their
|
|
107
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
108
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
109
|
+
institute patent litigation against any entity (including a
|
|
110
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
111
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
112
|
+
or contributory patent infringement, then any patent licenses
|
|
113
|
+
granted to You under this License for that Work shall terminate
|
|
114
|
+
as of the date such litigation is filed.
|
|
115
|
+
|
|
116
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
117
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
118
|
+
modifications, and in Source or Object form, provided that You
|
|
119
|
+
meet the following conditions:
|
|
120
|
+
|
|
121
|
+
(a) You must give any other recipients of the Work or
|
|
122
|
+
Derivative Works a copy of this License; and
|
|
123
|
+
|
|
124
|
+
(b) You must cause any modified files to carry prominent notices
|
|
125
|
+
stating that You changed the files; and
|
|
126
|
+
|
|
127
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
128
|
+
that You distribute, all copyright, patent, trademark, and
|
|
129
|
+
attribution notices from the Source form of the Work,
|
|
130
|
+
excluding those notices that do not pertain to any part of
|
|
131
|
+
the Derivative Works; and
|
|
132
|
+
|
|
133
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
134
|
+
distribution, then any Derivative Works that You distribute must
|
|
135
|
+
include a readable copy of the attribution notices contained
|
|
136
|
+
within such NOTICE file, excluding those notices that do not
|
|
137
|
+
pertain to any part of the Derivative Works, in at least one
|
|
138
|
+
of the following places: within a NOTICE text file distributed
|
|
139
|
+
as part of the Derivative Works; within the Source form or
|
|
140
|
+
documentation, if provided along with the Derivative Works; or,
|
|
141
|
+
within a display generated by the Derivative Works, if and
|
|
142
|
+
wherever such third-party notices normally appear. The contents
|
|
143
|
+
of the NOTICE file are for informational purposes only and
|
|
144
|
+
do not modify the License. You may add Your own attribution
|
|
145
|
+
notices within Derivative Works that You distribute, alongside
|
|
146
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
147
|
+
that such additional attribution notices cannot be construed
|
|
148
|
+
as modifying the License.
|
|
149
|
+
|
|
150
|
+
You may add Your own copyright statement to Your modifications and
|
|
151
|
+
may provide additional or different license terms and conditions
|
|
152
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
153
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
154
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
155
|
+
the conditions stated in this License.
|
|
156
|
+
|
|
157
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
158
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
159
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
160
|
+
this License, without any additional terms or conditions.
|
|
161
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
162
|
+
the terms of any separate license agreement you may have executed
|
|
163
|
+
with Licensor regarding such Contributions.
|
|
164
|
+
|
|
165
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
166
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
167
|
+
except as required for reasonable and customary use in describing the
|
|
168
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
169
|
+
|
|
170
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
171
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
172
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
173
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
174
|
+
implied, including, without limitation, any warranties or conditions
|
|
175
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
176
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
177
|
+
appropriateness of using or redistributing the Work and assume any
|
|
178
|
+
risks associated with Your exercise of permissions under this License.
|
|
179
|
+
|
|
180
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
181
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
182
|
+
unless required by applicable law (such as deliberate and grossly
|
|
183
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
184
|
+
liable to You for damages, including any direct, indirect, special,
|
|
185
|
+
incidental, or consequential damages of any character arising as a
|
|
186
|
+
result of this License or out of the use or inability to use the
|
|
187
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
188
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
189
|
+
other commercial damages or losses), even if such Contributor
|
|
190
|
+
has been advised of the possibility of such damages.
|
|
191
|
+
|
|
192
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
193
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
194
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
195
|
+
or other liability obligations and/or rights consistent with this
|
|
196
|
+
License. However, in accepting such obligations, You may act only
|
|
197
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
198
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
199
|
+
defend, and hold each Contributor harmless for any liability
|
|
200
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
201
|
+
of your accepting any such warranty or additional liability.
|
|
202
|
+
|
|
203
|
+
END OF TERMS AND CONDITIONS
|
|
204
|
+
|
|
205
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
206
|
+
|
|
207
|
+
To apply the Apache License to your work, attach the following
|
|
208
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
209
|
+
replaced with your own identifying information. (Don't include
|
|
210
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
211
|
+
comment syntax for the file format. We also recommend that a
|
|
212
|
+
file or class name and description of purpose be included on the
|
|
213
|
+
same "printed page" as the copyright notice for easier
|
|
214
|
+
identification within third-party archives.
|
|
215
|
+
|
|
216
|
+
Copyright [yyyy] [name of copyright owner]
|
|
217
|
+
|
|
218
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
219
|
+
you may not use this file except in compliance with the License.
|
|
220
|
+
You may obtain a copy of the License at
|
|
221
|
+
|
|
222
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
223
|
+
|
|
224
|
+
Unless required by applicable law or agreed to in writing, software
|
|
225
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
226
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
227
|
+
See the License for the specific language governing permissions and
|
|
228
|
+
limitations under the License.
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
The @posthog/core package in packages/core is licensed under the MIT License below.
|
|
234
|
+
Third-party code remains subject to its respective notices in this file.
|
|
235
|
+
This owning notice is preserved from posthog-js-lite, from which @posthog/core was migrated:
|
|
236
|
+
https://github.com/PostHog/posthog-js-lite/blob/5fb7bee96f739b243dfea5589e2027f16629e8cd/LICENSE
|
|
237
|
+
|
|
238
|
+
MIT License
|
|
239
|
+
|
|
240
|
+
Copyright (c) 2022 PostHog (part of Hiberly Inc)
|
|
241
|
+
|
|
242
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
243
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
244
|
+
in the Software without restriction, including without limitation the rights
|
|
245
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
246
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
247
|
+
furnished to do so, subject to the following conditions:
|
|
248
|
+
|
|
249
|
+
The above copyright notice and this permission notice shall be included in all
|
|
250
|
+
copies or substantial portions of the Software.
|
|
251
|
+
|
|
252
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
253
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
254
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
255
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
256
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
257
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
258
|
+
SOFTWARE.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
packages/core/src/error-tracking/parsers/index.ts and its compiled distributions contain code
|
|
263
|
+
derived from TraceKit. This license only applies to the relevant code.
|
|
264
|
+
|
|
265
|
+
MIT License
|
|
266
|
+
|
|
267
|
+
Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.
|
|
268
|
+
|
|
269
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
270
|
+
software and associated documentation files(the 'Software'), to deal in the Software
|
|
271
|
+
without restriction, including without limitation the rights to use, copy, modify,
|
|
272
|
+
merge, publish, distribute, sublicense, and / or sell copies of the Software, and to
|
|
273
|
+
permit persons to whom the Software is furnished to do so, subject to the following
|
|
274
|
+
conditions:
|
|
275
|
+
|
|
276
|
+
The above copyright notice and this permission notice shall be included in all copies
|
|
277
|
+
or substantial portions of the Software.
|
|
278
|
+
|
|
279
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
280
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
281
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
282
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
283
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
|
284
|
+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
packages/core/src/vendor/uuidv7.ts and its compiled distributions contain code from uuidv7:
|
|
289
|
+
https://github.com/LiosK/uuidv7/blob/f30b7a7faff73afbce0b27a46c638310f96912ba/src/index.ts
|
|
290
|
+
|
|
291
|
+
Copyright 2021-2023 LiosK
|
|
292
|
+
|
|
293
|
+
This code is licensed under the Apache License, Version 2.0, reproduced above.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
Some files in this codebase contain code from getsentry/sentry-javascript.
|
|
298
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
299
|
+
|
|
300
|
+
MIT License
|
|
301
|
+
|
|
302
|
+
Copyright (c) 2012 Functional Software, Inc. dba Sentry
|
|
303
|
+
|
|
304
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
305
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
306
|
+
the Software without restriction, including without limitation the rights to
|
|
307
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
308
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
309
|
+
so, subject to the following conditions:
|
|
310
|
+
|
|
311
|
+
The above copyright notice and this permission notice shall be included in all
|
|
312
|
+
copies or substantial portions of the Software.
|
|
313
|
+
|
|
314
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
315
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
316
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
317
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
318
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
319
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
320
|
+
SOFTWARE.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
Some files in this codebase contain code from getsentry/sentry-react-native.
|
|
325
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
326
|
+
|
|
327
|
+
The MIT License (MIT)
|
|
328
|
+
|
|
329
|
+
Copyright (c) 2017 Sentry
|
|
330
|
+
|
|
331
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
332
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
333
|
+
in the Software without restriction, including without limitation the rights
|
|
334
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
335
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
336
|
+
furnished to do so, subject to the following conditions:
|
|
337
|
+
|
|
338
|
+
The above copyright notice and this permission notice shall be included in all
|
|
339
|
+
copies or substantial portions of the Software.
|
|
340
|
+
|
|
341
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
342
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
343
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
344
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
345
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
346
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
347
|
+
SOFTWARE.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
Some files in this codebase contain code from facebook/metro by Meta Platforms, Inc. and affiliates.
|
|
352
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
353
|
+
|
|
354
|
+
MIT License
|
|
355
|
+
|
|
356
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
357
|
+
|
|
358
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
359
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
360
|
+
in the Software without restriction, including without limitation the rights
|
|
361
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
362
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
363
|
+
furnished to do so, subject to the following conditions:
|
|
364
|
+
|
|
365
|
+
The above copyright notice and this permission notice shall be included in all
|
|
366
|
+
copies or substantial portions of the Software.
|
|
367
|
+
|
|
368
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
369
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
370
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
371
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
372
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
373
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
374
|
+
SOFTWARE.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
Some files in this codebase contain code from expo/expo by 650 Industries, Inc. (aka Expo).
|
|
379
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
380
|
+
|
|
381
|
+
The MIT License (MIT)
|
|
382
|
+
|
|
383
|
+
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
|
|
384
|
+
|
|
385
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
386
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
387
|
+
in the Software without restriction, including without limitation the rights
|
|
388
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
389
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
390
|
+
furnished to do so, subject to the following conditions:
|
|
391
|
+
|
|
392
|
+
The above copyright notice and this permission notice shall be included in all
|
|
393
|
+
copies or substantial portions of the Software.
|
|
394
|
+
|
|
395
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
396
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
397
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
398
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
399
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
400
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
401
|
+
SOFTWARE.
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
Some files in this codebase contain code from agentcathq/agentcat-typescript-sdk (formerly MCPCat/mcpcat-typescript-sdk).
|
|
406
|
+
In such cases it is explicitly stated in the file header. This license only applies to the relevant code in such cases.
|
|
407
|
+
|
|
408
|
+
MIT License
|
|
409
|
+
|
|
410
|
+
Copyright (c) 2025 AgentCat, Inc. (formerly MCPcat)
|
|
411
|
+
|
|
412
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
413
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
414
|
+
in the Software without restriction, including without limitation the rights
|
|
415
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
416
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
417
|
+
furnished to do so, subject to the following conditions:
|
|
418
|
+
|
|
419
|
+
The above copyright notice and this permission notice shall be included in all
|
|
420
|
+
copies or substantial portions of the Software.
|
|
421
|
+
|
|
422
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
423
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
424
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
425
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
426
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
427
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
428
|
+
SOFTWARE.
|
|
429
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The first pause after a 429, doubling up to the longest. */
|
|
2
|
+
export declare const FIRST_PAUSE_MS: number;
|
|
3
|
+
export declare const LONGEST_PAUSE_MS: number;
|
|
4
|
+
/** The pause after a 413. */
|
|
5
|
+
export declare const TOO_LARGE_PAUSE_MS: number;
|
|
6
|
+
/** What backing off needs from posthog-js. */
|
|
7
|
+
export interface Pausable {
|
|
8
|
+
has_opted_out_capturing(): boolean;
|
|
9
|
+
stopSessionRecording?(): void;
|
|
10
|
+
startSessionRecording?(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface Backoff {
|
|
13
|
+
/** Whether events should be held back now. */
|
|
14
|
+
paused(): boolean;
|
|
15
|
+
/** An answer Aura gave to a batch (posthog-js's `on_request_error`). Anything but 413 and 429 is ignored. */
|
|
16
|
+
noticed(statusCode: number | undefined): void;
|
|
17
|
+
}
|
|
18
|
+
/** A back-off for this posthog-js instance. `now` and `later` are for tests. */
|
|
19
|
+
export declare function backoff(instance: () => Pausable | null, now?: () => number, later?: (fn: () => void, ms: number) => unknown): Backoff;
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PostHogConfig } from 'posthog-js/dist/module.full.no-external';
|
|
2
|
+
import { IGNORE_INPUT_CLASS, MASK_CLASS, type MergedRecordingSettings, NO_CAPTURE_CLASS, type PageRecordingSettings, PRIVATE_ATTRIBUTE } from './settings';
|
|
3
|
+
export { IGNORE_INPUT_CLASS, MASK_CLASS, NO_CAPTURE_CLASS, PRIVATE_ATTRIBUTE };
|
|
4
|
+
/** Signal's API, where the recorder sends what it records. */
|
|
5
|
+
export declare const DEFAULT_HOST = "https://api.findsignal.io";
|
|
6
|
+
/** The API's first address, still served: a page that names it as its host is going straight to Signal, not through a proxy. */
|
|
7
|
+
export declare const FIRST_HOST = "https://aura-liart-mu.vercel.app";
|
|
8
|
+
/** The path on Aura's API that speaks PostHog's capture protocol. */
|
|
9
|
+
export declare const INGEST_PATH = "/v1/ingest";
|
|
10
|
+
/** The first-party proxy setup adds on the team's own domain: `/_aura/v1/ingest/*` forwards to Aura's ingest. */
|
|
11
|
+
export declare const PROXY_PATH = "/_aura";
|
|
12
|
+
/** Sessions shorter than this aren't sent (and the ingest drops any that are). */
|
|
13
|
+
export declare const MIN_SESSION_MS = 5000;
|
|
14
|
+
export type Consent = 'granted' | 'pending';
|
|
15
|
+
/**
|
|
16
|
+
* The page's own recording settings (masking, maskAllText, maskSelectors, blockSelectors, neverRecord, sampleRate) are merged with
|
|
17
|
+
* the project's from Aura's dashboard, and can only make them stricter (src/settings.ts).
|
|
18
|
+
*/
|
|
19
|
+
export interface RecorderOptions extends PageRecordingSettings {
|
|
20
|
+
/** The project's recorder key from Aura (it starts with `arp_`). It's public, like an analytics key. */
|
|
21
|
+
key: string;
|
|
22
|
+
/**
|
|
23
|
+
* Aura's API (the default), or a proxy on your own domain that forwards `/v1/ingest/*` to it: `'/_aura'` (a path on
|
|
24
|
+
* the page's own site) or a full address. If the proxy answers 404, the recorder goes straight to Aura for the visit.
|
|
25
|
+
*/
|
|
26
|
+
host?: string;
|
|
27
|
+
/** Your app's release (a version or commit), so each session says which release it saw. */
|
|
28
|
+
release?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the visitor already agreed to be recorded. Until they do (the default), posthog-js isn't started: nothing is
|
|
31
|
+
* recorded, stored or sent, not even a request. Their answer from an earlier visit counts too (`optIn`, `optOut`).
|
|
32
|
+
*/
|
|
33
|
+
consent?: Consent;
|
|
34
|
+
}
|
|
35
|
+
/** A path on the page's own site, like `/_aura` (not `//cdn.example`, which is another site). */
|
|
36
|
+
export declare const isRelativeHost: (host: string | undefined) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Where requests go: `host` without a trailing slash, plus the ingest path unless the host already ends in it. A
|
|
39
|
+
* relative host (`/_aura`) is resolved against the page's origin, so posthog-js always gets a full address.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ingestHost(host: string | undefined, origin?: string): string;
|
|
42
|
+
/** Aura's own ingest, where the recorder goes when there's no proxy, or when the proxy isn't there. */
|
|
43
|
+
export declare const DIRECT_INGEST: string;
|
|
44
|
+
/** Whether `host` is a proxy rather than Aura's own address. */
|
|
45
|
+
export declare const isProxy: (host: string | undefined, origin?: string) => boolean;
|
|
46
|
+
/** The page's origin (`https://shop.example.com`), or undefined when its address can't be read. */
|
|
47
|
+
export declare function originOf(href: string | undefined): string | undefined;
|
|
48
|
+
/** PostHog adds a trailing slash to its paths (`/e/`); Aura's routes have none, so a browser never follows a redirect. */
|
|
49
|
+
export declare function withoutTrailingSlash(url: URL): URL;
|
|
50
|
+
/**
|
|
51
|
+
* The posthog-js settings for these options. `location` is the page's, read at send time. `settings` is what the
|
|
52
|
+
* recorder runs with now: the page's own until the project's arrive with the remote config, then both merged.
|
|
53
|
+
*/
|
|
54
|
+
export declare function auraConfig(options: RecorderOptions, location?: () => {
|
|
55
|
+
href: string;
|
|
56
|
+
hostname: string;
|
|
57
|
+
} | undefined, settings?: () => MergedRecordingSettings, paused?: () => boolean): Partial<PostHogConfig>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Where the answer is kept, in local storage. */
|
|
2
|
+
export declare const CONSENT_KEY = "aura_recorder_consent";
|
|
3
|
+
export type Answer = 'granted' | 'denied';
|
|
4
|
+
type Storage = Pick<globalThis.Storage, 'getItem' | 'setItem'>;
|
|
5
|
+
/** The visitor's remembered answer, or null when they haven't answered (or storage is blocked). */
|
|
6
|
+
export declare function rememberedAnswer(storage?: Storage | null): Answer | null;
|
|
7
|
+
/** The replay event's tag. */
|
|
8
|
+
export declare const OPT_IN_TAG = "aura_opt_in";
|
|
9
|
+
/**
|
|
10
|
+
* `explicit`: the person said yes on this page view (`optIn()`, when no yes was remembered). `stored`: a yes remembered
|
|
11
|
+
* from an earlier visit, one the page's consent tool passes on from an earlier visit (`optIn({ earlier: true })`), or one
|
|
12
|
+
* the page said as it loaded (`consent: 'granted'`, `data-consent="granted"`).
|
|
13
|
+
*/
|
|
14
|
+
export declare const OPT_IN_KINDS: readonly ['explicit', 'stored'];
|
|
15
|
+
export type OptInKind = (typeof OPT_IN_KINDS)[number];
|
|
16
|
+
/** The mark's payload: its kind, and when the yes was given, in milliseconds since 1970. */
|
|
17
|
+
export interface OptInMark {
|
|
18
|
+
kind: OptInKind;
|
|
19
|
+
at: number;
|
|
20
|
+
}
|
|
21
|
+
/** Remembers the visitor's answer. In a private window or with blocked storage, it lasts the page. */
|
|
22
|
+
export declare function rememberAnswer(answer: Answer, storage?: Storage | null): void;
|
|
23
|
+
export {};
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** An event's name: letters, digits, `_`, `.` and `-`, up to 64 characters, like `upgrade_payment_failed`. */
|
|
2
|
+
export declare const EVENT_NAME: RegExp;
|
|
3
|
+
/** A property's name: the same, starting with a letter. */
|
|
4
|
+
export declare const PROPERTY_NAME: RegExp;
|
|
5
|
+
/** The most properties one event may carry. */
|
|
6
|
+
export declare const PROPERTIES_MOST = 20;
|
|
7
|
+
/** The longest string a property may hold. */
|
|
8
|
+
export declare const PROPERTY_TEXT_MAX = 200;
|
|
9
|
+
/** A plan's name, like `pro` or `team-annual`. */
|
|
10
|
+
export declare const PLAN_NAME: RegExp;
|
|
11
|
+
/** The super property the plan goes in, which detection splits by. */
|
|
12
|
+
export declare const PLAN_PROPERTY = "aura_plan";
|
|
13
|
+
/**
|
|
14
|
+
* A property name that could hold a secret or something about the person: dropped. It's the ingest's list
|
|
15
|
+
* (SENSITIVE_PROPERTY in @getaura/shared, which a test holds this to) plus `name`, since an app's own event is the one
|
|
16
|
+
* place a person's name could be passed in on purpose.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SENSITIVE_KEY: RegExp;
|
|
19
|
+
/**
|
|
20
|
+
* Something shaped like a secret: a known key prefix, a JWT, a private key, an address with a password in it, or a
|
|
21
|
+
* long run of random-looking letters and digits. The ingest masks secrets again with Aura's full list.
|
|
22
|
+
*/
|
|
23
|
+
export declare function looksLikeSecret(value: string): boolean;
|
|
24
|
+
export type PropertyValue = string | number | boolean | null;
|
|
25
|
+
export type EventProperties = Record<string, PropertyValue>;
|
|
26
|
+
export interface CheckedEvent {
|
|
27
|
+
/** What may be sent, or null when the event is refused. */
|
|
28
|
+
event: string | null;
|
|
29
|
+
properties: EventProperties;
|
|
30
|
+
/** Why the event, or each property left out, was refused: shown to the builder as a warning. */
|
|
31
|
+
problems: string[];
|
|
32
|
+
}
|
|
33
|
+
/** An event's name and properties, with everything unsafe left out and the reason for each. */
|
|
34
|
+
export declare function checkEvent(event: unknown, properties?: unknown): CheckedEvent;
|
|
35
|
+
/** Why a plan name can't be used, or null when it can. */
|
|
36
|
+
export declare function planProblem(plan: unknown): string | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MergedRecordingSettings } from './settings';
|
|
2
|
+
export declare const VALUE_SHAPE_EVENT = "aura_value_shape";
|
|
3
|
+
export declare const VALIDATION_EVENT = "aura_validation";
|
|
4
|
+
/** The same lists and rules as `valueShape` in @getaura/shared (the tests hold them together). */
|
|
5
|
+
export declare const VALUE_LENGTH_MOST = 1000;
|
|
6
|
+
/** A value's shape as the recorder sends it: `kind:length:marks`, like `email:17:plus`. */
|
|
7
|
+
export declare function valueShape(value: string): string;
|
|
8
|
+
/** The most events of each kind one page view sends. */
|
|
9
|
+
export declare const FIELD_EVENTS_MOST = 50;
|
|
10
|
+
type Field = HTMLInputElement | HTMLTextAreaElement;
|
|
11
|
+
/** A field people type into: a text-like input or a text box. */
|
|
12
|
+
export declare function typedField(el: unknown): el is Field;
|
|
13
|
+
/** An element's part of the chain, as autocapture writes it: `input.wide:attr__id="email"`. Tag, id and first class only. */
|
|
14
|
+
export declare function part(el: Element): string;
|
|
15
|
+
/** A field's chain: itself, then its form. */
|
|
16
|
+
export declare function fieldChain(el: Element): string;
|
|
17
|
+
export type Send = (event: string, properties: Record<string, string>) => void;
|
|
18
|
+
/** The `aura_value_shape` event's properties for a field the person left, or null when it gets none. */
|
|
19
|
+
export declare function shapeProperties(el: unknown, settings: MergedRecordingSettings): Record<string, string> | null;
|
|
20
|
+
/**
|
|
21
|
+
* The `aura_validation` event's properties, or null for a field that gets none. `message` is the element whose words
|
|
22
|
+
* are the message, if any. With the shape of the field's value as the message appeared, so what it judged is known.
|
|
23
|
+
*/
|
|
24
|
+
export declare function validationProperties(el: unknown, via: 'aria-invalid' | 'alert' | 'invalid', message: Element | null, settings: MergedRecordingSettings): Record<string, string> | null;
|
|
25
|
+
/**
|
|
26
|
+
* Watches the page's fields and sends the two events with `send`. Returns how to stop. Started once posthog-js runs
|
|
27
|
+
* (after consent); `settings` is read at each event, so the project's level applies as soon as it arrives.
|
|
28
|
+
*/
|
|
29
|
+
export declare function watchFields(doc: Document, send: Send, settings: () => MergedRecordingSettings): () => void;
|
|
30
|
+
export {};
|