@nodewrite-labs/analytics-sdk 0.0.0-stage → 0.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.
@@ -0,0 +1,9 @@
1
+ import {
2
+ readRequestGeo,
3
+ recordAnalyticsEvent
4
+ } from "../chunk-GWOVVKP3.js";
5
+ import "../chunk-F7BY2JQ3.js";
6
+ export {
7
+ readRequestGeo,
8
+ recordAnalyticsEvent
9
+ };
package/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "@nodewrite-labs/analytics-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Analytics SDK for page views and named clicks, with Postgres storage and a Payload admin screen.",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "packageManager": "pnpm@12.11.2",
9
+ "engines": {
10
+ "node": ">=22"
11
+ },
12
+ "workspaces": [
13
+ "playground"
14
+ ],
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
23
+ "./client": {
24
+ "types": "./dist/client/index.d.ts",
25
+ "import": "./dist/client/index.js"
26
+ },
27
+ "./server": {
28
+ "types": "./dist/server/index.d.ts",
29
+ "import": "./dist/server/index.js"
30
+ },
31
+ "./postgres": {
32
+ "types": "./dist/postgres/index.d.ts",
33
+ "import": "./dist/postgres/index.js"
34
+ },
35
+ "./payload": {
36
+ "types": "./dist/payload/index.d.ts",
37
+ "import": "./dist/payload/index.js"
38
+ },
39
+ "./payload/admin-view": {
40
+ "types": "./dist/payload/admin-view.d.ts",
41
+ "import": "./dist/payload/admin-view.js"
42
+ },
43
+ "./payload/nav-link": {
44
+ "types": "./dist/payload/nav-link.d.ts",
45
+ "import": "./dist/payload/nav-link.js"
46
+ }
47
+ },
48
+ "files": [
49
+ "dist",
50
+ "src/postgres/schema.sql",
51
+ "README.md"
52
+ ],
53
+ "scripts": {
54
+ "typecheck": "tsc --noEmit",
55
+ "test": "vitest run",
56
+ "build": "tsup"
57
+ },
58
+ "peerDependencies": {
59
+ "@payloadcms/next": "*",
60
+ "payload": "*",
61
+ "pg": "*"
62
+ },
63
+ "peerDependenciesMeta": {
64
+ "@payloadcms/next": {
65
+ "optional": true
66
+ },
67
+ "payload": {
68
+ "optional": true
69
+ },
70
+ "pg": {
71
+ "optional": true
72
+ }
73
+ },
74
+ "devDependencies": {
75
+ "@payloadcms/next": "3.92.0",
76
+ "@types/node": "^22.20.5",
77
+ "@types/pg": "^8.23.1",
78
+ "@types/react": "19.2.14",
79
+ "esbuild": "^0.28.2",
80
+ "graphql": "^16.14.2",
81
+ "jsdom": "^30.1.3",
82
+ "payload": "3.92.0",
83
+ "pg": "^8.23.1",
84
+ "react": "^19.3.1",
85
+ "tsup": "^9.0.0",
86
+ "typescript": "6.0.3",
87
+ "vite": "^8.3.5",
88
+ "vitest": "^5.0.5"
89
+ }
90
+ }
@@ -0,0 +1,12 @@
1
+ CREATE TABLE IF NOT EXISTS analytics_event (
2
+ id uuid primary key,
3
+ kind text not null,
4
+ path text not null,
5
+ locale text,
6
+ occurred_at timestamptz not null,
7
+ duration_seconds integer,
8
+ country text,
9
+ city text,
10
+ session_id text,
11
+ event_name text
12
+ );