Skip to content

Commit

Permalink
Merge branch 'main' into features-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie authored Aug 20, 2024
2 parents beba61a + df62e27 commit 6aab12b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions modules/posthog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export interface ModuleOptions {
disabled?: boolean;
}

type PosthogRuntimeConfig = Required<ModuleOptions>;

export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'nuxt-posthog',
Expand All @@ -64,14 +66,14 @@ export default defineNuxtModule<ModuleOptions>({
const { resolve } = createResolver(import.meta.url);

// Public runtimeConfig
nuxt.options.runtimeConfig.public.posthog = defu<ModuleOptions, ModuleOptions[]>(
nuxt.options.runtimeConfig.public.posthog = defu<PosthogRuntimeConfig, PosthogRuntimeConfig[]>(
nuxt.options.runtimeConfig.public.posthog,
{
publicKey: options.publicKey,
host: options.host,
capturePageViews: options.capturePageViews,
clientOptions: options.clientOptions,
disabled: options.disabled,
capturePageViews: options.capturePageViews ?? true,
clientOptions: options.clientOptions ?? {},
disabled: options.disabled ?? false,
},
);

Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default defineNuxtConfig({
'@nuxtjs/sitemap', // https://sitemap.nuxtjs.org/usage/sitemap
'nuxt-og-image',
'floating-vue/nuxt',
// '@zadigetvoltaire/nuxt-gtm',
'@zadigetvoltaire/nuxt-gtm',
'nuxt-schema-org',
'@nuxtjs/fontaine',
'@formkit/auto-animate/nuxt',
Expand Down

0 comments on commit 6aab12b

Please sign in to comment.