@apstal/analytics 1.0.0 → 1.0.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/index.js +20 -0
- package/package.json +2 -2
package/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apstal Analytics SDK - ES Module Wrapper
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function initApstal(projectId, options = {}) {
|
|
6
|
+
if (typeof window === 'undefined') {
|
|
7
|
+
// Prevent errors during SSR (Server-Side Rendering in Next.js/Nuxt)
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Set configuration globally
|
|
12
|
+
window.APSTAL_PROJECT_ID = projectId;
|
|
13
|
+
|
|
14
|
+
if (options.endpoint) {
|
|
15
|
+
window.APSTAL_ENDPOINT = options.endpoint;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Dynamically load the tracking script logic
|
|
19
|
+
require('./src/apstal.js');
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apstal/analytics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Official tracking library for Apstal — the conversational AI Web Analyst.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/apstal/analytics.git"
|