mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 16:03:39 +01:00
chore: updated documentation
This commit is contained in:
parent
06893bf3c3
commit
95197098af
@ -1,9 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Telemetry in bruno is just an anonymous visit counter (triggered once per day).
|
||||||
|
* The only details shared are:
|
||||||
|
* - OS (ex: mac, windows, linux)
|
||||||
|
* - Bruno Version (ex: 1.3.0)
|
||||||
|
* We don't track usage analytics / micro-interactions / crash logs / anything else.
|
||||||
|
*/
|
||||||
|
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import getConfig from 'next/config';
|
import getConfig from 'next/config';
|
||||||
import { PostHog } from 'posthog-node';
|
import { PostHog } from 'posthog-node';
|
||||||
import platformLib from 'platform';
|
import platformLib from 'platform';
|
||||||
import { uuid } from 'utils/common';
|
import { uuid } from 'utils/common';
|
||||||
import { isElectron } from 'utils/common/platform';
|
|
||||||
|
|
||||||
const { publicRuntimeConfig } = getConfig();
|
const { publicRuntimeConfig } = getConfig();
|
||||||
const posthogApiKey = 'phc_7gtqSrrdZRohiozPMLIacjzgHbUlhalW1Bu16uYijMR';
|
const posthogApiKey = 'phc_7gtqSrrdZRohiozPMLIacjzgHbUlhalW1Bu16uYijMR';
|
||||||
@ -17,11 +24,6 @@ const isDevEnv = () => {
|
|||||||
return publicRuntimeConfig.ENV === 'dev';
|
return publicRuntimeConfig.ENV === 'dev';
|
||||||
};
|
};
|
||||||
|
|
||||||
// Todo support chrome and firefox extension
|
|
||||||
const getPlatform = () => {
|
|
||||||
return isElectron() ? 'electron' : 'web';
|
|
||||||
};
|
|
||||||
|
|
||||||
const getPosthogClient = () => {
|
const getPosthogClient = () => {
|
||||||
if (posthogClient) {
|
if (posthogClient) {
|
||||||
return posthogClient;
|
return posthogClient;
|
||||||
@ -52,13 +54,11 @@ const trackStart = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const trackingId = getAnonymousTrackingId();
|
const trackingId = getAnonymousTrackingId();
|
||||||
const platform = getPlatform();
|
|
||||||
const client = getPosthogClient();
|
const client = getPosthogClient();
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: trackingId,
|
distinctId: trackingId,
|
||||||
event: 'start',
|
event: 'start',
|
||||||
properties: {
|
properties: {
|
||||||
platform: platform,
|
|
||||||
os: platformLib.os.family,
|
os: platformLib.os.family,
|
||||||
version: '1.3.0'
|
version: '1.3.0'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user