-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Analytics to inspection-capture-web and demo-app
- Loading branch information
Showing
21 changed files
with
168 additions
and
38 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
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 |
---|---|---|
@@ -1,28 +1,31 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { MonitoringProvider } from '@monkvision/monitoring'; | ||
import { AnalyticsProvider } from '@monkvision/analytics'; | ||
import { Auth0Provider } from '@auth0/auth0-react'; | ||
import { getEnvOrThrow, MonkThemeProvider } from '@monkvision/common'; | ||
import { sentryMonitoringAdapter } from './sentry'; | ||
import { posthogAnalyticsAdapter } from './posthog'; | ||
import { AppRouter } from './components'; | ||
import './index.css'; | ||
import './i18n'; | ||
|
||
ReactDOM.render( | ||
<MonitoringProvider adapter={sentryMonitoringAdapter}> | ||
<Auth0Provider | ||
domain={getEnvOrThrow('REACT_APP_AUTH_DOMAIN')} | ||
clientId={getEnvOrThrow('REACT_APP_AUTH_CLIENT_ID')} | ||
authorizationParams={{ | ||
redirect_uri: window.location.origin, | ||
audience: getEnvOrThrow('REACT_APP_AUTH_AUDIENCE'), | ||
prompt: 'login', | ||
}} | ||
> | ||
<MonkThemeProvider> | ||
<AppRouter /> | ||
</MonkThemeProvider> | ||
</Auth0Provider> | ||
<AnalyticsProvider adapter={posthogAnalyticsAdapter}> | ||
<Auth0Provider | ||
domain={getEnvOrThrow('REACT_APP_AUTH_DOMAIN')} | ||
clientId={getEnvOrThrow('REACT_APP_AUTH_CLIENT_ID')} | ||
authorizationParams={{ | ||
redirect_uri: window.location.origin, | ||
audience: getEnvOrThrow('REACT_APP_AUTH_AUDIENCE'), | ||
prompt: 'login', | ||
}} | ||
> | ||
<MonkThemeProvider> | ||
<AppRouter /> | ||
</MonkThemeProvider> | ||
</Auth0Provider> | ||
</AnalyticsProvider> | ||
</MonitoringProvider>, | ||
document.getElementById('root'), | ||
); |
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,9 @@ | ||
import { PosthogAnalyticsAdapter } from '@monkvision/posthog'; | ||
|
||
export const posthogAnalyticsAdapter = new PosthogAnalyticsAdapter({ | ||
token: 'phc_iNzK7jyK2bLtRi9vNWnzQqy74rIPlXPdgGs0qgJrSfL', | ||
api_host: 'https://eu.posthog.com', | ||
environnement: 'development', | ||
projectName: 'test', | ||
release: '1.0.0', | ||
}); |
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,20 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# analytics | ||
Monk analytics abstraction package. | ||
|
||
![npm latest package](https://img.shields.io/npm/v/@monkvision/analytics/latest.svg) | ||
|
||
## Overview | ||
This package provides an abstraction layer for the analytics features in the MonkJs ecosystem. If you plan on using any | ||
of these features, you can use this package to properly set up the analytics inside your application. | ||
|
||
In the MonkJs SDK, we use this "abstraction" package as a way of offering the possibility to developers to choose their | ||
own Analytics tools and platform if they don't want to use Posthog (the platform used internally by Monk). | ||
|
||
## Complete Documentation | ||
As every other package in the SDK, please refer to | ||
[its README file](https://github.com/monkvision/monkjs/blob/main/packages/analytics/README.md) for a complete | ||
documentation on how this package works. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_position: 2 | ||
--- | ||
|
||
# camera-web | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 3 | ||
sidebar_position: 4 | ||
--- | ||
|
||
# common-ui-web | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 2 | ||
sidebar_position: 3 | ||
--- | ||
|
||
# common | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
sidebar_position: 5 | ||
--- | ||
|
||
# inspection-capture-web | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 5 | ||
sidebar_position: 6 | ||
--- | ||
|
||
# inspection-report-web | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 6 | ||
sidebar_position: 7 | ||
--- | ||
|
||
# monitoring | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 7 | ||
sidebar_position: 8 | ||
--- | ||
|
||
# network | ||
|
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,20 @@ | ||
--- | ||
sidebar_position: 9 | ||
--- | ||
|
||
# posthog | ||
Posthog implementation used to analyze MonkJs SDK and applications. | ||
|
||
![npm latest package](https://img.shields.io/npm/v/@monkvision/posthog/latest.svg) | ||
|
||
## Overview | ||
This package provides an implementation of the analytics abstraction layers exposed by the | ||
[analytics package](docs/packages/analytics.md) using the [Posthog](https://posthog.com/) analytics platform. Posthog is | ||
the platform used internally by Monk to analyze the user's behaviour in our applications. Unless you already have your own analytics | ||
platform, and you really don't want to add Posthog as a dependency in your app, we highly recommend installing this | ||
analytics adapter in your app. | ||
|
||
## Complete Documentation | ||
As every other package in the SDK, please refer to | ||
[its README file](https://github.com/monkvision/monkjs/blob/main/packages/posthog/README.md) for a complete | ||
documentation on how this package works. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 8 | ||
sidebar_position: 10 | ||
--- | ||
|
||
# sentry | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 9 | ||
sidebar_position: 11 | ||
--- | ||
|
||
# sights | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 10 | ||
sidebar_position: 12 | ||
--- | ||
|
||
# types | ||
|
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
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
Oops, something went wrong.