create-db 1.0.3-pr45-DC-4829-source-flag-17164565333.0 → 1.0.3-pr45-DC-4829-source-flag-17164819065.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.
- package/analytics.js +11 -6
- package/package.json +1 -1
package/analytics.js
CHANGED
|
@@ -8,12 +8,17 @@ class EventCaptureError extends Error {
|
|
|
8
8
|
|
|
9
9
|
class PosthogEventCapture {
|
|
10
10
|
async capture(eventName, properties = {}) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const POSTHOG_API_HOST = process.env.POSTHOG_API_HOST;
|
|
12
|
+
const POSTHOG_KEY = process.env.POSTHOG_API_KEY;
|
|
13
|
+
if (!POSTHOG_API_HOST || !POSTHOG_KEY) {
|
|
14
|
+
if (process.env.NODE_ENV === "development") {
|
|
15
|
+
console.warn(
|
|
16
|
+
"Analytics disabled: missing POSTHOG_API_HOST or POSTHOG_API_KEY."
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const POSTHOG_CAPTURE_URL = `${POSTHOG_API_HOST.replace(/\/+$/, "")}/capture`;
|
|
17
22
|
|
|
18
23
|
const payload = {
|
|
19
24
|
api_key: POSTHOG_KEY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-db",
|
|
3
|
-
"version": "1.0.3-pr45-DC-4829-source-flag-
|
|
3
|
+
"version": "1.0.3-pr45-DC-4829-source-flag-17164819065.0",
|
|
4
4
|
"description": "Instantly create a temporary Prisma Postgres database with one command, then claim and persist it in your Prisma Data Platform project when ready.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "",
|