@ebitex/visitors-sdk 0.1.0 → 0.1.224
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 +201 -201
- package/README.md +55 -53
- package/dist/client.d.ts +11 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -5
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/visitors.d.ts.map +1 -1
- package/dist/visitors.js +9 -0
- package/dist/visitors.js.map +1 -1
- package/package.json +66 -66
package/LICENSE
CHANGED
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
# @ebitex/visitors-sdk
|
|
2
|
-
|
|
3
|
-
Recognise a returning visitor **with their consent**, honour Global Privacy Control and your own consent
|
|
4
|
-
tool, and let them forget their device, from any site. You do not need forms, or any other ebitex product
|
|
5
|
-
beyond Audience.
|
|
6
|
-
|
|
7
|
-
- Zero runtime dependencies. Works with a plain `<script>` tag, with a bundler, and with React.
|
|
8
|
-
- The visitor's token is kept in a first-party cookie **only while ebitex says that device may be
|
|
9
|
-
recognised**, and removed when recognition is denied, withdrawn, or the device is forgotten.
|
|
10
|
-
- "Forget this device" is one operation with several doors: a footer link, a function, a React button, or a
|
|
11
|
-
plain request from your own server.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
| `@ebitex/visitors-sdk
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
# @ebitex/visitors-sdk
|
|
2
|
+
|
|
3
|
+
Recognise a returning visitor **with their consent**, honour Global Privacy Control and your own consent
|
|
4
|
+
tool, and let them forget their device, from any site. You do not need forms, or any other ebitex product
|
|
5
|
+
beyond Audience.
|
|
6
|
+
|
|
7
|
+
- Zero runtime dependencies. Works with a plain `<script>` tag, with a bundler, and with React.
|
|
8
|
+
- The visitor's token is kept in a first-party cookie **only while ebitex says that device may be
|
|
9
|
+
recognised**, and removed when recognition is denied, withdrawn, or the device is forgotten.
|
|
10
|
+
- "Forget this device" is one operation with several doors: a footer link, a function, a React button, or a
|
|
11
|
+
plain request from your own server.
|
|
12
|
+
- `track('pricing-viewed', { ... })` puts an event on the timeline of the person a recognised device belongs to.
|
|
13
|
+
It is not a page-view tracker: nothing is stored for an anonymous visitor.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install @ebitex/visitors-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or, on a page with no build step:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<script type="module"
|
|
25
|
+
src="https://cdn.jsdelivr.net/npm/@ebitex/visitors-sdk@0/dist/script.js"
|
|
26
|
+
data-ebitex-key="ebx_your_browser_key"></script>
|
|
27
|
+
<footer><a href="#" data-ebitex-forget>Forget this device</a></footer>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick start
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createVisitors } from '@ebitex/visitors-sdk'
|
|
34
|
+
|
|
35
|
+
const visitors = createVisitors({ key: 'ebx_your_browser_key' })
|
|
36
|
+
const { consent } = await visitors.refresh()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
You need an Audience **delivery key** that is restricted to your site's origins (Audience, Settings, Delivery
|
|
40
|
+
keys). The key is visible to anyone who views your page, which is safe only because of that restriction.
|
|
41
|
+
Never put an unrestricted key in a page.
|
|
42
|
+
|
|
43
|
+
Full guide: <https://developers.ebitex.io/getting-started/visitors/>
|
|
44
|
+
|
|
45
|
+
## Entry points
|
|
46
|
+
|
|
47
|
+
| Import | For |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `@ebitex/visitors-sdk` | `createVisitors`, `cookieStorage`, the types |
|
|
50
|
+
| `@ebitex/visitors-sdk/react` | `VisitorsProvider`, `useVisitors`, `ForgetDeviceButton` (React is an optional peer) |
|
|
51
|
+
| `@ebitex/visitors-sdk/script` | The drop-in script for pages with no build step |
|
|
52
|
+
|
|
53
|
+
## Licence
|
|
54
|
+
|
|
55
|
+
Apache-2.0
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VisitorSession } from './types.js';
|
|
1
|
+
import type { TrackResult, VisitorSession } from './types.js';
|
|
2
2
|
/** The default API address. */
|
|
3
3
|
export declare const DEFAULT_ENDPOINT = "https://api.ebitex.io";
|
|
4
4
|
/** An error answer from ebitex, or an answer the SDK could not read. */
|
|
@@ -9,7 +9,9 @@ export declare class VisitorsApiError extends Error {
|
|
|
9
9
|
readonly code: string | undefined;
|
|
10
10
|
/** The `X-Request-Id` of the answer. Quote it when you ask for help. */
|
|
11
11
|
readonly requestId: string | undefined;
|
|
12
|
-
|
|
12
|
+
/** When the answer named what was wrong with each member (a bad `name`, an undeclared or mistyped property), a message for each, keyed by member. */
|
|
13
|
+
readonly errors: Record<string, string> | undefined;
|
|
14
|
+
constructor(message: string, status: number, code?: string, requestId?: string, errors?: Record<string, string>);
|
|
13
15
|
}
|
|
14
16
|
export interface RawConsent {
|
|
15
17
|
cmp: 'granted' | 'denied' | null;
|
|
@@ -20,6 +22,13 @@ export interface RawConsent {
|
|
|
20
22
|
export interface VisitorsClient {
|
|
21
23
|
session(visitor: string | null, consent: RawConsent): Promise<VisitorSession>;
|
|
22
24
|
forget(visitor: string): Promise<string>;
|
|
25
|
+
track(body: {
|
|
26
|
+
visitor: string;
|
|
27
|
+
consent: RawConsent;
|
|
28
|
+
name: string;
|
|
29
|
+
properties?: Record<string, unknown>;
|
|
30
|
+
eventId?: string;
|
|
31
|
+
}): Promise<TrackResult>;
|
|
23
32
|
}
|
|
24
33
|
export declare function createClient(key: string, endpoint: string, doFetch: typeof globalThis.fetch): VisitorsClient;
|
|
25
34
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|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,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAClJ;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,cAAc,CAgD5G"}
|
package/dist/client.js
CHANGED
|
@@ -8,12 +8,15 @@ export class VisitorsApiError extends Error {
|
|
|
8
8
|
code;
|
|
9
9
|
/** The `X-Request-Id` of the answer. Quote it when you ask for help. */
|
|
10
10
|
requestId;
|
|
11
|
-
|
|
11
|
+
/** When the answer named what was wrong with each member (a bad `name`, an undeclared or mistyped property), a message for each, keyed by member. */
|
|
12
|
+
errors;
|
|
13
|
+
constructor(message, status, code, requestId, errors) {
|
|
12
14
|
super(message);
|
|
13
15
|
this.name = 'VisitorsApiError';
|
|
14
16
|
this.status = status;
|
|
15
17
|
this.code = code;
|
|
16
18
|
this.requestId = requestId;
|
|
19
|
+
this.errors = errors;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
export function createClient(key, endpoint, doFetch) {
|
|
@@ -21,7 +24,7 @@ export function createClient(key, endpoint, doFetch) {
|
|
|
21
24
|
async function post(path, body) {
|
|
22
25
|
let response;
|
|
23
26
|
try {
|
|
24
|
-
response = await doFetch(`${base}/audience/delivery/v1
|
|
27
|
+
response = await doFetch(`${base}/audience/delivery/v1/${path}`, {
|
|
25
28
|
method: 'POST',
|
|
26
29
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${key}` },
|
|
27
30
|
body: JSON.stringify(body),
|
|
@@ -34,24 +37,32 @@ export function createClient(key, endpoint, doFetch) {
|
|
|
34
37
|
const json = await response.json().catch(() => null);
|
|
35
38
|
if (!response.ok) {
|
|
36
39
|
const code = typeof json?.error === 'string' ? json.error : undefined;
|
|
37
|
-
|
|
40
|
+
const errors = json?.errors;
|
|
41
|
+
throw new VisitorsApiError(code ?? `The request failed with status ${response.status}.`, response.status, code, requestId, errors && typeof errors === 'object' && !Array.isArray(errors) ? errors : undefined);
|
|
38
42
|
}
|
|
39
43
|
return json;
|
|
40
44
|
}
|
|
41
45
|
return {
|
|
42
46
|
async session(visitor, consent) {
|
|
43
|
-
const json = await post('session', { visitor, consent });
|
|
47
|
+
const json = await post('visitors/session', { visitor, consent });
|
|
44
48
|
if (!isSession(json))
|
|
45
49
|
throw new VisitorsApiError('The answer was not a visitor session.', 200, 'invalid_response');
|
|
46
50
|
return json;
|
|
47
51
|
},
|
|
48
52
|
async forget(visitor) {
|
|
49
|
-
const json = await post('forget', { visitor });
|
|
53
|
+
const json = await post('visitors/forget', { visitor });
|
|
50
54
|
const message = json?.message;
|
|
51
55
|
if (typeof message !== 'string')
|
|
52
56
|
throw new VisitorsApiError('The answer was not a forget confirmation.', 200, 'invalid_response');
|
|
53
57
|
return message;
|
|
54
58
|
},
|
|
59
|
+
async track(body) {
|
|
60
|
+
const json = await post('events', body);
|
|
61
|
+
const result = json;
|
|
62
|
+
if (typeof result?.recorded !== 'boolean')
|
|
63
|
+
throw new VisitorsApiError('The answer was not an event result.', 200, 'invalid_response');
|
|
64
|
+
return { recorded: result.recorded, duplicate: result.duplicate === true, reason: typeof result.reason === 'string' ? result.reason : null };
|
|
65
|
+
},
|
|
55
66
|
};
|
|
56
67
|
}
|
|
57
68
|
function isSession(value) {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAA;AAEvD,wEAAwE;AACxE,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,wFAAwF;IAC/E,MAAM,CAAQ;IAEvB,8HAA8H;IACrH,IAAI,CAAoB;IAEj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AI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IACjE,MAAM,KAAK,GAAG,OAAgC,CAAA;IAC9C,OAAO,CACL,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,CAAC;QACnE,CAAC,KAAK,CAAC,SAAS,KAAK,aAAa,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC;QACpE,OAAO,KAAK,CAAC,oBAAoB,KAAK,QAAQ;QAC9C,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAClC,KAAK,CAAC,QAAQ,KAAK,IAAI,CACxB,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { createVisitors } from './visitors.js';
|
|
|
2
2
|
export { cookieStorage } from './storage.js';
|
|
3
3
|
export type { CookieStorageOptions } from './storage.js';
|
|
4
4
|
export { VisitorsApiError, DEFAULT_ENDPOINT } from './client.js';
|
|
5
|
-
export type { ConsentMessages, ConsentOptions, ConsentState, Visitors, VisitorSession, VisitorsOptions, VisitorsSnapshot, VisitorStorage, } from './types.js';
|
|
5
|
+
export type { ConsentMessages, ConsentOptions, ConsentState, TrackOptions, TrackResult, Visitors, VisitorSession, VisitorsOptions, VisitorsSnapshot, VisitorStorage, } from './types.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAChE,YAAY,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAChE,YAAY,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAA"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function VisitorsProvider({ visitors, children }: {
|
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
8
|
/** The visitor's current token and consent state, which re-render the component when they change, and the calls that change them. */
|
|
9
|
-
export declare function useVisitors(): VisitorsSnapshot & Pick<Visitors, 'refresh' | 'setConsent' | 'forget' | 'ready'>;
|
|
9
|
+
export declare function useVisitors(): VisitorsSnapshot & Pick<Visitors, 'refresh' | 'setConsent' | 'forget' | 'track' | 'ready'>;
|
|
10
10
|
export interface ForgetDeviceButtonProps {
|
|
11
11
|
/** The button's label. Defaults to "Forget this device"; pass your own for another language. */
|
|
12
12
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkF,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACtH,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAI7D,+JAA+J;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A6BtK"}
|
package/dist/react/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export function useVisitors() {
|
|
|
19
19
|
return last.current;
|
|
20
20
|
}, [visitors]);
|
|
21
21
|
const snapshot = useSyncExternalStore(visitors.subscribe, read, read);
|
|
22
|
-
return { ...snapshot, refresh: visitors.refresh, setConsent: visitors.setConsent, forget: visitors.forget, ready: visitors.ready };
|
|
22
|
+
return { ...snapshot, refresh: visitors.refresh, setConsent: visitors.setConsent, forget: visitors.forget, track: visitors.track, ready: visitors.ready };
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* A button that forgets the visitor's device, asks the organization's own confirmation question first, and shows the
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAkB,MAAM,OAAO,CAAA;AAGtH,MAAM,eAAe,GAAG,aAAa,CAAkB,IAAI,CAAC,CAAA;AAE5D,+JAA+J;AAC/J,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAA+C;IAClG,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAAG,QAAQ,GAA4B,CAAA;AACzF,CAAC;AAED,qIAAqI;AACrI,MAAM,UAAU,WAAW;IACzB,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC5C,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAEvF,iGAAiG;IACjG,MAAM,IAAI,GAAG,MAAM,CAAmB,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3F,MAAM,IAAI,GAAG,WAAW,CAAC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isitorSession {
|
|
|
44
44
|
visitor: string;
|
|
45
45
|
consent: ConsentState;
|
|
46
46
|
}
|
|
47
|
+
/** What happened to an event passed to {@link Visitors.track}. */
|
|
48
|
+
export interface TrackResult {
|
|
49
|
+
/** `true` when the event is on the person's timeline in Audience, including a replay of one that already was. */
|
|
50
|
+
recorded: boolean;
|
|
51
|
+
/** `true` when this was a replay of an event with the same `eventId`, so nothing new was written. */
|
|
52
|
+
duplicate: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When nothing was recorded, why: `'no_visitor'` (the device holds no token, or is not linked to a person), `'session_token'`
|
|
55
|
+
* (the visitor is not being recognised across visits), `'recognition_not_granted'`, `'revoked'` (the device was forgotten) or
|
|
56
|
+
* `'token_invalid'`. Otherwise `null`. None of these is an error: an anonymous visitor's events are simply not stored.
|
|
57
|
+
*/
|
|
58
|
+
reason: string | null;
|
|
59
|
+
}
|
|
60
|
+
/** Options for {@link Visitors.track}. */
|
|
61
|
+
export interface TrackOptions {
|
|
62
|
+
/** Sending the same id again from the same device records nothing new, so a retry is safe. At most 160 characters. */
|
|
63
|
+
eventId?: string;
|
|
64
|
+
}
|
|
47
65
|
/**
|
|
48
66
|
* Where the token is kept between visits. The SDK calls `set` only while ebitex reports that this device may be
|
|
49
67
|
* recognised, and calls `remove` when recognition is denied or withdrawn, and when the device is forgotten. Writing an
|
|
@@ -107,6 +125,16 @@ export interface Visitors extends VisitorsSnapshot {
|
|
|
107
125
|
* If the request fails the token is kept and the promise rejects, so the visitor can try again.
|
|
108
126
|
*/
|
|
109
127
|
forget(): Promise<string | null>;
|
|
128
|
+
/**
|
|
129
|
+
* Records something the visitor did, on their timeline in Audience, for example `track('pricing-viewed', { buyerType: 'agency' })`.
|
|
130
|
+
*
|
|
131
|
+
* It is **not** a page-view tracker. An event is stored only when this device is recognised and already linked to a person; for
|
|
132
|
+
* an anonymous visitor nothing is stored and the result says why (it is not an error). `name` is lower-case words joined by
|
|
133
|
+
* hyphens, and `properties` may hold only visit properties your organization has declared, typed as declared. Each device may record
|
|
134
|
+
* at most 200 events in any 24 hours. Rejects with a {@link VisitorsApiError} for a bad name or an undeclared or mistyped property
|
|
135
|
+
* (its `errors` member says which) and when the daily cap is reached (`event_cap_reached`).
|
|
136
|
+
*/
|
|
137
|
+
track(name: string, properties?: Record<string, unknown>, options?: TrackOptions): Promise<TrackResult>;
|
|
110
138
|
/** Calls `listener` whenever the token or consent state changes. Returns a function that stops listening. */
|
|
111
139
|
subscribe(listener: (snapshot: VisitorsSnapshot) => void): () => void;
|
|
112
140
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,qHAAqH;IACrH,GAAG,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAA;IAEjC;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb,+GAA+G;IAC/G,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,qGAAqG;AACrG,MAAM,WAAW,eAAe;IAC9B,4HAA4H;IAC5H,mBAAmB,EAAE,MAAM,CAAA;IAE3B,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAA;IAErB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,WAAW,EAAE,SAAS,GAAG,QAAQ,CAAA;IAEjC,oKAAoK;IACpK,MAAM,EAAE,MAAM,CAAA;IAEd,qFAAqF;IACrF,aAAa,EAAE,MAAM,CAAA;IAErB,4KAA4K;IAC5K,SAAS,EAAE,aAAa,GAAG,SAAS,CAAA;IAEpC,+GAA+G;IAC/G,oBAAoB,EAAE,MAAM,CAAA;IAE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,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,CAAA;IAElC;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IAE5D;;;;;;;OAOG;IACH,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEhC;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAEvG,6GAA6G;IAC7G,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CACtE"}
|
package/dist/visitors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitors.d.ts","sourceRoot":"","sources":["../src/visitors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"visitors.d.ts","sourceRoot":"","sources":["../src/visitors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6D,QAAQ,EAAE,eAAe,EAAoC,MAAM,YAAY,CAAA;AAExJ;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CA2HjE"}
|
package/dist/visitors.js
CHANGED
|
@@ -115,6 +115,15 @@ export function createVisitors(options) {
|
|
|
115
115
|
return message;
|
|
116
116
|
});
|
|
117
117
|
},
|
|
118
|
+
track(name, properties, trackOptions) {
|
|
119
|
+
return run(async () => {
|
|
120
|
+
await ready;
|
|
121
|
+
// Nothing to attribute an event to without a token: say so without a request.
|
|
122
|
+
if (token === null)
|
|
123
|
+
return { recorded: false, duplicate: false, reason: 'no_visitor' };
|
|
124
|
+
return client.track({ visitor: token, consent: rawConsent(), name, properties, eventId: trackOptions?.eventId });
|
|
125
|
+
});
|
|
126
|
+
},
|
|
118
127
|
subscribe(listener) {
|
|
119
128
|
listeners.add(listener);
|
|
120
129
|
return () => {
|
package/dist/visitors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitors.js","sourceRoot":"","sources":["../src/visitors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG5C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,IAAI,gBAAgB,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACzI,MAAM,OAAO,GAA+B,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,aAAa,EAAE,CAAC,CAAA;IAExH,IAAI,cAAc,GAAmB,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAA;IAC3D,IAAI,KAAK,GAAkB,IAAI,CAAA;IAC/B,IAAI,OAAO,GAAwB,IAAI,CAAA;IACvC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwC,CAAA;IAEjE,wIAAwI;IACxI,IAAI,IAAI,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAA;IAC9C,SAAS,GAAG,CAAI,IAAsB;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QA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|
|
4
|
-
"description": "Recognise a returning visitor with their consent, honour Global Privacy Control and your own consent tool, and let them forget their device, from any site. No forms needed.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"ebitex",
|
|
7
|
-
"audience",
|
|
8
|
-
"consent",
|
|
9
|
-
"gdpr",
|
|
10
|
-
"privacy",
|
|
11
|
-
"global-privacy-control",
|
|
12
|
-
"visitor",
|
|
13
|
-
"forget-me"
|
|
14
|
-
],
|
|
15
|
-
"license": "Apache-2.0",
|
|
16
|
-
"homepage": "https://developers.ebitex.io/getting-started/visitors/",
|
|
17
|
-
"type": "module",
|
|
18
|
-
"sideEffects": [
|
|
19
|
-
"./dist/script.js"
|
|
20
|
-
],
|
|
21
|
-
"files": [
|
|
22
|
-
"dist"
|
|
23
|
-
],
|
|
24
|
-
"exports": {
|
|
25
|
-
".": {
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"import": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./react": {
|
|
30
|
-
"types": "./dist/react/index.d.ts",
|
|
31
|
-
"import": "./dist/react/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./script": {
|
|
34
|
-
"types": "./dist/script.d.ts",
|
|
35
|
-
"import": "./dist/script.js"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"publishConfig": {
|
|
39
|
-
"access": "public"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsc -p tsconfig.build.json",
|
|
43
|
-
"lint": "oxlint",
|
|
44
|
-
"test": "vitest run"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"react": ">=19"
|
|
48
|
-
},
|
|
49
|
-
"peerDependenciesMeta": {
|
|
50
|
-
"react": {
|
|
51
|
-
"optional": true
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@testing-library/jest-dom": "^7.0.0",
|
|
56
|
-
"@testing-library/react": "^16.3.2",
|
|
57
|
-
"@types/react": "^19.2.17",
|
|
58
|
-
"@vitejs/plugin-react": "^6.0.3",
|
|
59
|
-
"jsdom": "^29.1.1",
|
|
60
|
-
"oxlint": "^1.71.0",
|
|
61
|
-
"react": "^19.2.7",
|
|
62
|
-
"react-dom": "^19.2.7",
|
|
63
|
-
"typescript": "~6.0.2",
|
|
64
|
-
"vitest": "^4.1.10"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ebitex/visitors-sdk",
|
|
3
|
+
"version": "0.1.224",
|
|
4
|
+
"description": "Recognise a returning visitor with their consent, honour Global Privacy Control and your own consent tool, and let them forget their device, from any site. No forms needed.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ebitex",
|
|
7
|
+
"audience",
|
|
8
|
+
"consent",
|
|
9
|
+
"gdpr",
|
|
10
|
+
"privacy",
|
|
11
|
+
"global-privacy-control",
|
|
12
|
+
"visitor",
|
|
13
|
+
"forget-me"
|
|
14
|
+
],
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"homepage": "https://developers.ebitex.io/getting-started/visitors/",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./dist/script.js"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./react": {
|
|
30
|
+
"types": "./dist/react/index.d.ts",
|
|
31
|
+
"import": "./dist/react/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./script": {
|
|
34
|
+
"types": "./dist/script.d.ts",
|
|
35
|
+
"import": "./dist/script.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.build.json",
|
|
43
|
+
"lint": "oxlint",
|
|
44
|
+
"test": "vitest run"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=19"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"react": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
56
|
+
"@testing-library/react": "^16.3.2",
|
|
57
|
+
"@types/react": "^19.2.17",
|
|
58
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
59
|
+
"jsdom": "^29.1.1",
|
|
60
|
+
"oxlint": "^1.71.0",
|
|
61
|
+
"react": "^19.2.7",
|
|
62
|
+
"react-dom": "^19.2.7",
|
|
63
|
+
"typescript": "~6.0.2",
|
|
64
|
+
"vitest": "^4.1.10"
|
|
65
|
+
}
|
|
66
|
+
}
|