Skip to content

Commit

Permalink
documented the qwik-labs move of insights
Browse files Browse the repository at this point in the history
  • Loading branch information
shairez committed Oct 31, 2024
1 parent b121d20 commit 70c732f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .changeset/nine-otters-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'@qwik.dev/core': major
---

`qwik-labs` package has been removed in favor of experimental features.
So the "Insights" vite plugin and components have been moved to core as an experimental feature.

In order to use it, you need to -

**1)** add `insights` to the experimental array in `vite.config.ts`:

```ts
qwikVite({
experimental: ['insights']
}),
```

**2)** Import and use the `qwikInsights` vite plugin from `@qwik.dev/core/insights/vite`:

```ts
import { qwikInsights } from '@qwik.dev/core/insights/vite';
```

**3)** import the `<Insights>` component from `@qwik.dev/core/insights` and use it in your `root.tsx` file: :

```tsx title="root.tsx"
import { Insights } from '@qwik.dev/core/insights';

// ...rest of root.tsx file

return (
<Insights publicApiKey="..." postUrl="..." />
/* ...qwik app */
);
```
4 changes: 3 additions & 1 deletion packages/insights/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export default defineConfig(async () => {
plugins: [
macroPlugin({ preset: 'pandacss' }),
qwikRouter(),
qwikVite(),
qwikVite({
experimental: ['insights'],
}),
tsconfigPaths({ projects: ['.'] }),
qwikInsights({ publicApiKey: loadEnv('', '.', '').PUBLIC_QWIK_INSIGHTS_KEY }),
],
Expand Down

0 comments on commit 70c732f

Please sign in to comment.