@posthog/nuxt 1.7.1 → 1.7.3
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/dist/module.json +1 -1
- package/dist/module.mjs +17 -4
- package/package.json +5 -5
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,6 +5,17 @@ import { dirname } from 'node:path';
|
|
|
5
5
|
|
|
6
6
|
const filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const resolvedDirname = dirname(filename);
|
|
8
|
+
const DEFAULT_NUXT_HOST = "https://us.i.posthog.com";
|
|
9
|
+
function normalizeApiKey(value) {
|
|
10
|
+
return typeof value === "string" ? value.trim() : "";
|
|
11
|
+
}
|
|
12
|
+
function normalizePersonalApiKey(value) {
|
|
13
|
+
return typeof value === "string" ? value.trim() : "";
|
|
14
|
+
}
|
|
15
|
+
function normalizeHost(value) {
|
|
16
|
+
const normalizedValue = typeof value === "string" ? value.trim() : "";
|
|
17
|
+
return normalizedValue || DEFAULT_NUXT_HOST;
|
|
18
|
+
}
|
|
8
19
|
const module$1 = defineNuxtModule({
|
|
9
20
|
meta: {
|
|
10
21
|
name: "@posthog/nuxt",
|
|
@@ -21,13 +32,15 @@ const module$1 = defineNuxtModule({
|
|
|
21
32
|
}),
|
|
22
33
|
setup(options, nuxt) {
|
|
23
34
|
const resolver = createResolver(import.meta.url);
|
|
35
|
+
const normalizedPublicKey = normalizeApiKey(options.publicKey);
|
|
36
|
+
const normalizedHost = normalizeHost(options.host);
|
|
24
37
|
addPlugin(resolver.resolve("./runtime/vue-plugin"));
|
|
25
38
|
addServerPlugin(resolver.resolve("./runtime/nitro-plugin"));
|
|
26
39
|
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
27
40
|
Object.assign(nuxt.options.runtimeConfig.public, {
|
|
28
41
|
posthog: {
|
|
29
|
-
publicKey:
|
|
30
|
-
host:
|
|
42
|
+
publicKey: normalizedPublicKey,
|
|
43
|
+
host: normalizedHost,
|
|
31
44
|
debug: options.debug
|
|
32
45
|
},
|
|
33
46
|
posthogClientConfig: options.clientConfig
|
|
@@ -74,9 +87,9 @@ const module$1 = defineNuxtModule({
|
|
|
74
87
|
const cliEnv = {
|
|
75
88
|
...process.env,
|
|
76
89
|
RUST_LOG: `posthog_cli=${logLevel}`,
|
|
77
|
-
POSTHOG_CLI_HOST:
|
|
90
|
+
POSTHOG_CLI_HOST: normalizedHost,
|
|
78
91
|
POSTHOG_CLI_PROJECT_ID: projectId,
|
|
79
|
-
POSTHOG_CLI_API_KEY: sourcemapsConfig.personalApiKey
|
|
92
|
+
POSTHOG_CLI_API_KEY: normalizePersonalApiKey(sourcemapsConfig.personalApiKey)
|
|
80
93
|
};
|
|
81
94
|
return (args) => {
|
|
82
95
|
return spawnLocal(cliBinaryPath, args, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/nuxt",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Nuxt module for Posthog 🦔",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@posthog/cli": "~0.7.3",
|
|
27
27
|
"@nuxt/kit": ">=3.7.0",
|
|
28
|
-
"posthog-node": "5.29.
|
|
29
|
-
"@posthog/plugin-utils": "1.1.
|
|
30
|
-
"@posthog/core": "1.25.
|
|
31
|
-
"posthog-js": "1.369.
|
|
28
|
+
"posthog-node": "5.29.4",
|
|
29
|
+
"@posthog/plugin-utils": "1.1.1",
|
|
30
|
+
"@posthog/core": "1.25.3",
|
|
31
|
+
"posthog-js": "1.369.5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.0.0",
|