mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
Bulk rename across 989 files: - Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc. - Repository URLs: posthog/posthog-js → hanzoai/insights-js - Brand names: PostHog → Insights - File renames: 259 reference JSON files, source files, workflow files - Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
21 lines
712 B
JavaScript
21 lines
712 B
JavaScript
// Keep in sync with https://github.com/Insights/insights.com/blob/master/contents/docs/integrate/_snippets/install-nuxt.mdx
|
|
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
|
|
|
|
import insights from '@hanzo/insights'
|
|
export default defineNuxtPlugin(() => {
|
|
const runtimeConfig = useRuntimeConfig()
|
|
const insightsClient = insights.init(runtimeConfig.public.insightsPublicKey, {
|
|
api_host: runtimeConfig.public.insightsHost,
|
|
capture_pageview: 'history_change',
|
|
loaded: (insights) => {
|
|
if (import.meta.env.MODE === 'development') insights.debug()
|
|
},
|
|
})
|
|
|
|
return {
|
|
provide: {
|
|
insights: () => insightsClient,
|
|
},
|
|
}
|
|
})
|