stat18ion 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112,3 +112,13 @@ const Analytics = () => {
112
112
  return null;
113
113
  };
114
114
  exports.Analytics = Analytics;
115
+ // Auto-initialize if running in a browser and script tag has data-site-id
116
+ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
117
+ const script = document.currentScript || document.querySelector('script[data-site-id]');
118
+ if (script) {
119
+ const siteId = script.getAttribute('data-site-id');
120
+ if (siteId && !config.siteId) {
121
+ (0, exports.init)({ siteId });
122
+ }
123
+ }
124
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stat18ion",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Privacy-first, lightweight analytics tracker for the modern web.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",