Skip to content

Commit

Permalink
feat(site): reverse proxy posthog events
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 6, 2024
1 parent daf25bd commit d5f807f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default defineNuxtConfig({
'/company/company/about-us.html': {redirect: '/about-us'},
'/community.html': {redirect: '/community'},
'/slack': {redirect: 'https://api.kestra.io/v1/communities/slack/redirect'},
'/events/**': { proxy: 'https://eu.posthog.com/**' },
},

build: {
Expand Down
10 changes: 8 additions & 2 deletions plugins/cookieconsent.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import 'vanilla-cookieconsent'
import posthog from 'posthog-js'

export default defineNuxtPlugin(nuxtApp => {
let isProd = process.env.NODE_ENV === "production";
let isProd = process.env.NODE_ENV === "production" || true;

if (isProd) {
posthog.init('phc_8lNe3YuQj9gyJcCJOGy4RwMCUFzHQ7siGPr8aeodhxR', {api_host: 'https://eu.posthog.com'})
posthog.init(
'phc_8lNe3YuQj9gyJcCJOGy4RwMCUFzHQ7siGPr8aeodhxR',
{
api_host: '/events',
ui_host: 'https://eu.posthog.com',
}
)
}

nuxtApp.hook('page:finish', () => {
Expand Down

0 comments on commit d5f807f

Please sign in to comment.