Skip to content

Commit 3369a9c

Browse files
committedNov 25, 2024
fix: cprrectly set proxyBaseEndpoint when proxy enabled (closes #37)
1 parent 460fcec commit 3369a9c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/runtime/plugin.client.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { defineNuxtPlugin } from 'nuxt/app'
66
export default defineNuxtPlugin({
77
name: 'plausible',
88
setup() {
9-
const options = useRuntimeConfig().public
10-
.plausible as Required<ModuleOptions>
9+
const options = useRuntimeConfig().public.plausible as Required<ModuleOptions>
1110

1211
if (!options.enabled) {
1312
return
@@ -17,7 +16,7 @@ export default defineNuxtPlugin({
1716
...options,
1817
logIgnored: options.logIgnoredEvents,
1918
domain: options.domain || window.location.hostname,
20-
apiHost: options.proxy ? window.location.origin : options.apiHost,
19+
apiHost: options.proxy ? options.proxyBaseEndpoint : options.apiHost,
2120
})
2221

2322
return {

0 commit comments

Comments
 (0)
Please sign in to comment.