Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Aug 19, 2024
1 parent 219a3d6 commit 5e021fd
Showing 1 changed file with 6 additions and 4 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

0 comments on commit 5e021fd

Please sign in to comment.