we0-analyze-sdk 0.1.0 → 0.1.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/.env.example ADDED
@@ -0,0 +1,8 @@
1
+ # Project table prefix
2
+ PROJECT_ID=
3
+
4
+ # Supabase REST endpoint
5
+ SUPABASE_URL=
6
+
7
+ # Public Supabase key
8
+ SUPABASE_ANON_KEY=
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Minimal browser analytics SDK boilerplate for pageview, pageleave, attribution, device, and conversion events.
4
4
 
5
+ https://www.npmjs.com/package/we0-analyze-sdk
6
+
5
7
  ## Install
6
8
 
7
9
  ```bash
@@ -7,7 +7,8 @@ function readRecord(value) {
7
7
  }
8
8
  // 拼接表名
9
9
  function tableName(projectId, name) {
10
- return `${projectId}____${name}`;
10
+ const tableProjectId = projectId.replaceAll('-', '_');
11
+ return `${tableProjectId}____${name}`;
11
12
  }
12
13
  function endpoint(config, table) {
13
14
  return `${config.url.replace(/\/$/, '')}/rest/v1/${encodeURIComponent(table)}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "we0-analyze-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Minimal browser analytics SDK for pageview, PV, and UV tracking.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -12,6 +12,7 @@
12
12
  }
13
13
  },
14
14
  "files": [
15
+ ".env.example",
15
16
  "dist",
16
17
  "docs",
17
18
  "AGENTS.md",