@apstal/analytics 1.0.2 โ†’ 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,10 +52,18 @@ Deploy your website, open a few pages, and click a few buttons. Go back to [apst
52
52
 
53
53
  ## ๐Ÿ›ก๏ธ Privacy & Compliance
54
54
 
55
- Apstal is designed to comply with strict privacy regulations:
56
- - ๐Ÿ•ต๏ธโ€โ™‚๏ธ **Cookieless**: No persistent tracking cookies are stored.
57
- - ๐Ÿ‡ช๐Ÿ‡บ **GDPR / CCPA Compliant**: Out-of-the-box compliance, no annoying cookie banners required.
58
- - ๐Ÿงผ **PII Scrubbing**: Automatically redacts emails, credit cards, passwords, and tokens before they reach the server.
55
+ Apstal processes data in compliance with applicable data protection laws, including the GDPR and CCPA:
56
+
57
+ - ๐Ÿ‡ช๐Ÿ‡บ **GDPR & CCPA Compliant**: Apstal processes data strictly as a **Data Processor** on behalf of the Customer (the **Data Controller**), ensuring full compliance with GDPR and CCPA under our Data Processing Addendum (DPA).
58
+ - ๐Ÿ•ต๏ธโ€โ™‚๏ธ **Cookieless Telemetry**: Does not use cookies, LocalStorage, or SessionStorage to track users across domains, minimizing legal compliance overhead.
59
+ - ๐Ÿงผ **Client-Side PII Masking**: Forcefully replaces all Personally Identifiable Information (PII), passwords, and form inputs with asterisks (`***`) directly inside the visitor's browser *before* any transmission to the servers.
60
+ - ๐ŸŒ **IP Anonymization**: Momentarily processes IP addresses for geolocation and network classification. The raw IP address string is **never stored** in the database and is discarded immediately.
61
+ - โš™๏ธ **Consent & CMP Support**: Fully supports external Consent Management Platforms (CMPs). The implementation of appropriate cookie banners and consent mechanisms remains the sole responsibility of the site owner (Data Controller).
62
+
63
+ For more details, please review our official legal documents:
64
+ - ๐Ÿ“„ [Data Processing Addendum (DPA)](https://apstal.com/dpa)
65
+ - ๐Ÿ”’ [Privacy Policy](https://apstal.com/privacy)
66
+ - ๐Ÿ“ [Terms of Service](https://apstal.com/terms)
59
67
 
60
68
  ## License
61
69
 
package/index.js CHANGED
@@ -15,6 +15,6 @@ export function initApstal(projectId, options = {}) {
15
15
  window.APSTAL_ENDPOINT = options.endpoint;
16
16
  }
17
17
 
18
- // Dynamically load the tracking script logic
19
- require('./src/apstal.js');
18
+ // Dynamically load the tracking script logic using standard ESM import
19
+ import('./src/apstal.js');
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apstal/analytics",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Official tracking library for Apstal โ€” the conversational AI Web Analyst.",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/apstal.js CHANGED
@@ -6,14 +6,22 @@ import { gzipSync, strToU8 } from "fflate";
6
6
  (function () {
7
7
  "use strict";
8
8
  var script = document.currentScript;
9
- if (!script) return;
10
- var PROJECT_ID = script.getAttribute("data-project");
9
+ if (!script) {
10
+ var scripts = document.getElementsByTagName('script');
11
+ for (var i = 0; i < scripts.length; i++) {
12
+ if (scripts[i].src && scripts[i].src.indexOf('/apstal') !== -1) {
13
+ script = scripts[i];
14
+ break;
15
+ }
16
+ }
17
+ }
18
+ var PROJECT_ID = window.APSTAL_PROJECT_ID || (script && script.getAttribute("data-project"));
11
19
  if (!PROJECT_ID) {
12
20
  return;
13
21
  }
14
- var scriptSrc = script.src;
22
+ var scriptSrc = (script && script.src) || "https://apstal.com/apstal";
15
23
  var API_URL = scriptSrc.substring(0, scriptSrc.lastIndexOf("/")) + "/api/v1/m";
16
- var customEndpoint = script.getAttribute("data-endpoint");
24
+ var customEndpoint = window.APSTAL_ENDPOINT || (script && script.getAttribute("data-endpoint"));
17
25
  if (customEndpoint) API_URL = customEndpoint;
18
26
  var BATCH_INTERVAL = 5e3;
19
27
  var MAX_BATCH_SIZE = 25;