Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add telemetry for toolbar apps (#9816)
* feat: server side event * feat: send events to server * fix: use proper event * fix: remove unnecessary changes * chore: changeset * Update .changeset/spicy-tips-remember.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * fix: use id --------- Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
- Loading branch information
1 parent
3435b7f
commit 2a44c8f
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": patch | ||
--- | ||
|
||
Adds telemetry for when apps are toggled in the dev toolbar. This data is completely anonymous and only the names of built-in apps are shared with us. This data will help us monitor how much the dev toolbar is used and which apps are used more. For more information on how Astro collects telemetry, visit the following page: https://astro.build/telemetry/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const EVENT_TOOLBAR_APP_TOGGLED = 'ASTRO_TOOLBAR_APP_TOGGLED'; | ||
|
||
interface AppToggledEventPayload { | ||
app: string; | ||
} | ||
|
||
export function eventAppToggled(options: { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
appName: 'other' | (string & {}); | ||
}): { eventName: string; payload: AppToggledEventPayload }[] { | ||
const payload: AppToggledEventPayload = { | ||
app: options.appName, | ||
}; | ||
|
||
return [{ eventName: EVENT_TOOLBAR_APP_TOGGLED, payload }]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters