Skip to content

Commit

Permalink
fix: access to raw runtime config (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien committed Jun 7, 2024
1 parent a3ce4b6 commit 921b5f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/app/plugin.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import type { Snippet } from "@microsoft/applicationinsights-web";
import { useRuntimeConfig } from "#imports";
import { createFetch } from "ofetch"
import { baseURL } from "#build/paths.mjs"
import { toRaw } from "vue"

export default defineNuxtPlugin({
name: 'nuxt-applicationinsights:client',
async setup(nuxtApp) {
const runtimeConfig = useRuntimeConfig()
const config: Snippet = {
config: runtimeConfig.public.applicationinsights ?? {}
config: toRaw(runtimeConfig.public).applicationinsights ?? {}
}

await nuxtApp.callHook('applicationinsights:config:client', config)
Expand Down

0 comments on commit 921b5f5

Please sign in to comment.