From 5e021fd33d1c5107e24285cf8b02ae017ec52309 Mon Sep 17 00:00:00 2001 From: bryantgillespie Date: Mon, 19 Aug 2024 09:34:54 -0400 Subject: [PATCH] fix types --- modules/posthog/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/posthog/index.ts b/modules/posthog/index.ts index 6f5d12d7..44b584c5 100644 --- a/modules/posthog/index.ts +++ b/modules/posthog/index.ts @@ -49,6 +49,8 @@ export interface ModuleOptions { disabled?: boolean; } +type PosthogRuntimeConfig = Required; + export default defineNuxtModule({ meta: { name: 'nuxt-posthog', @@ -64,14 +66,14 @@ export default defineNuxtModule({ const { resolve } = createResolver(import.meta.url); // Public runtimeConfig - nuxt.options.runtimeConfig.public.posthog = defu( + nuxt.options.runtimeConfig.public.posthog = defu( 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, }, );