aesirx-analytics 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -2
- package/dist/{Consent-7KHERFGJ.js → Consent-OBULXA4M.js} +1952 -1241
- package/dist/analytics.js +9798 -1038
- package/dist/chunk-RN267RCX.js +875 -0
- package/dist/index.js +5 -5
- package/package.json +12 -6
- package/dist/chunk-JQ6CXYV4.js +0 -34
package/README.md
CHANGED
@@ -19,11 +19,23 @@ Follow the instructions in: [https://github.com/aesirxio/analytics-1stparty](htt
|
|
19
19
|
1. Add script to `<head>`:
|
20
20
|
|
21
21
|
```
|
22
|
-
<script>
|
22
|
+
<script>
|
23
|
+
window.aesirx1stparty = "https://example.com"
|
24
|
+
window.aesirxClientID="[REPLACE THIS WITH THE PROVIDED CLIENT_ID]"
|
25
|
+
</script>
|
23
26
|
<script async defer src="YOUR_PROJECT_PATH/analytics.js"></script>
|
24
27
|
```
|
25
28
|
|
26
|
-
(`https://example.com` is the link to your 1st party server which must be installed)
|
29
|
+
1. (`https://example.com` is the link to your 1st party server which must be installed)
|
30
|
+
2. `CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
31
|
+
3. `CLIENT_SECRET` replace this with the provided `CLIENT_SECRET` from https://sso.aesirx.io/
|
32
|
+
|
33
|
+
##### Disable Consent Popup:
|
34
|
+
```
|
35
|
+
<script>
|
36
|
+
window.disableAnalyticsConsent = "true"
|
37
|
+
</script>
|
38
|
+
```
|
27
39
|
|
28
40
|
#### Usage in ReactJS
|
29
41
|
|
@@ -33,8 +45,16 @@ Follow the instructions in: [https://github.com/aesirxio/analytics-1stparty](htt
|
|
33
45
|
|
34
46
|
```
|
35
47
|
REACT_APP_ENDPOINT_ANALYTICS_URL=https://example.com
|
48
|
+
REACT_APP_SSO_CLIENT_ID=[REPLACE THIS WITH THE PROVIDED CLIENT_ID]
|
36
49
|
|
37
50
|
(https://example.com is the link to your 1st party server)
|
51
|
+
`CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
52
|
+
```
|
53
|
+
|
54
|
+
##### Disable Consent Popup:
|
55
|
+
add this environment variable to `.env`
|
56
|
+
```
|
57
|
+
REACT_APP_DISABLE_ANALYTICS_CONSENT=true
|
38
58
|
```
|
39
59
|
|
40
60
|
###### With react-router-dom v5:
|
@@ -66,8 +86,16 @@ export default AnalyticsContainer;
|
|
66
86
|
|
67
87
|
```
|
68
88
|
NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL=https://example.com
|
89
|
+
NEXT_PUBLIC_SSO_CLIENT_ID=[REPLACE THIS WITH THE PROVIDED CLIENT_ID]
|
69
90
|
|
70
91
|
(https://example.com is the link to your 1st party server)
|
92
|
+
`CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
93
|
+
```
|
94
|
+
|
95
|
+
##### Disable Consent Popup:
|
96
|
+
add this environment variable to `.env`
|
97
|
+
```
|
98
|
+
NEXT_PUBLIC_DISABLE_ANALYTICS_CONSENT=true
|
71
99
|
```
|
72
100
|
|
73
101
|
###### With next/router:
|
@@ -205,3 +233,45 @@ const CustomEvent = () => {
|
|
205
233
|
(`endPoint` is the link to your 1st party server which must be installed)
|
206
234
|
|
207
235
|
(`referer` is the referer domain)
|
236
|
+
|
237
|
+
## Customize CSS for Consent modal
|
238
|
+
Please follow below CSS example:
|
239
|
+
```
|
240
|
+
// Customize toast
|
241
|
+
.aesirxconsent .toast {
|
242
|
+
--aesirxconsent-toast-font-size: 16px;
|
243
|
+
--aesirxconsent-toast-padding-x: 0.75rem;
|
244
|
+
--aesirxconsent-toast-padding-y: 0.5rem;
|
245
|
+
--aesirxconsent-toast-spacing: 1.5rem;
|
246
|
+
--aesirxconsent-toast-zindex: 1049;
|
247
|
+
}
|
248
|
+
// Customize button
|
249
|
+
.aesirxconsent .btn {
|
250
|
+
--aesirxconsent-btn-font-size: 16px;
|
251
|
+
--aesirxconsent-btn-padding-x: 0.75rem;
|
252
|
+
--aesirxconsent-btn-padding-y: 0.375rem;
|
253
|
+
--aesirxconsent-btn-font-weight: 400;
|
254
|
+
--aesirxconsent-btn-line-height: 1.5;
|
255
|
+
}
|
256
|
+
// Customize button success
|
257
|
+
.aesirxconsent .btn-success {
|
258
|
+
--aesirxconsent-btn-color: #000;
|
259
|
+
--aesirxconsent-btn-bg: #1ab394;
|
260
|
+
--aesirxconsent-btn-border-color: #1ab394;
|
261
|
+
--aesirxconsent-btn-hover-color: #000;
|
262
|
+
--aesirxconsent-btn-hover-bg: #3cbea4;
|
263
|
+
--aesirxconsent-btn-hover-border-color: #31bb9f;
|
264
|
+
--aesirxconsent-btn-focus-shadow-rgb: 22, 152, 126;
|
265
|
+
--aesirxconsent-btn-active-color: #000;
|
266
|
+
--aesirxconsent-btn-active-bg: #48c2a9;
|
267
|
+
--aesirxconsent-btn-active-border-color: #31bb9f;
|
268
|
+
--aesirxconsent-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
269
|
+
--aesirxconsent-btn-disabled-color: #000;
|
270
|
+
--aesirxconsent-btn-disabled-bg: #1ab394;
|
271
|
+
--aesirxconsent-btn-disabled-border-color: #1ab394;
|
272
|
+
}
|
273
|
+
// To customize CSS for dark mode (Bootstrap dark mode)
|
274
|
+
[data-bs-theme=dark] .aesirxconsent {
|
275
|
+
color: #fff;
|
276
|
+
}
|
277
|
+
```
|