Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix insights docs #4598

Merged
merged 5 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions packages/docs/src/routes/docs/labs/insights/index.mdx
Expand Up @@ -2,6 +2,7 @@
title: 🧪 Insights
contributors:
- mhevery
- gioboa
---

# 🧪 Insights
Expand All @@ -13,8 +14,15 @@ Insights allow your application to collect real user usage information to optimi

The optimization consists of these parts:
- A `<Insights>` component which collects real user usage data.
- A hosted application with a database. (http://qwik-insights.builder.io)
- a vite time plugin which provides the bundle information.
- A registered application inside the builder.io database.
- A qwikVite configuration to load real user usage data during the build process.

> NOTE:
> To try this new feature please drop a message inside the [Qwik Discord server](https://qwik.builder.io/chat)
> Currently Insights info are hosted into builder database. This information are about the execution of symbols/chunks in the application.
> The implementation of the service is open-source and you have the choice to use ours or host your own.
> (Please note, this may become a paid service in the future.)


## `<Insights>` component

Expand Down Expand Up @@ -42,7 +50,7 @@ export default component$(() => {
});
```

You can get `PUBLIC_QWIK_INSIGHTS_KEY` by visiting https://qwik-insights.builder.io/ and creating an application.
You can get `PUBLIC_QWIK_INSIGHTS_KEY` by asking it in inside the [Qwik Discord server](https://qwik.builder.io/chat)

The `<Insights>` component collects this data:
- Timing information of symbols.
Expand All @@ -51,11 +59,7 @@ The `<Insights>` component collects this data:

NOTE: The `<Insights>` component does not collect any user identifiable information.

The information collected is sent to https://qwik-insights.builder.io/ for storage.

## Hosted application

https://qwik-insights.builder.io/ is hosted as part of Insights and it maintains statistical usage information on the application symbols. The implementation of the service is open-source, and you have the choice to use ours or host your own. (Please note, this may become a paid service in the future.)
The information collected is sent to builder.io database for storage.

## Vite integration

Expand All @@ -65,15 +69,15 @@ file: `vite.config.js`
```typescript
//..
import { defineConfig, loadEnv } from 'vite';
import { Insights } from '@builder.io/qwik-labs';
import { insightsEntryStrategy } from '@builder.io/qwik-labs/vite';


export default defineConfig(async () => {
return {
plugins: [
qwikVite({
entryStrategy: await insightsEntryStrategy({
publicApiKey: loadEnv('', '.').PUBLIC_QWIK_INSIGHT_KEY,
publicApiKey: loadEnv('', '.').PUBLIC_QWIK_INSIGHTS_KEY,
}),
}),
//...
Expand Down
1 change: 1 addition & 0 deletions packages/qwik-labs/package.json
Expand Up @@ -13,6 +13,7 @@
"types": "./lib-types/index.d.ts"
},
"./vite": {
"import": "./vite/index.js",
"require": "./vite/index.js",
"types": "./vite/index.d.ts"
}
Expand Down