Skip to content

Commit

Permalink
feat: Add LogRocket to do session replay and error tracking (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon5920 authored Oct 20, 2022
1 parent c014399 commit bc2a743
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_API_BASE_URL=
VITE_GTAG_ID=
VITE_LOG_ROCKET_ID=
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
env:
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}
VITE_GTAG_ID: ${{ secrets.VITE_GTAG_ID }}
VITE_LOG_ROCKET_ID: ${{ secrets.VITE_LOG_ROCKET_ID }}

- name: Deploy 🚀
uses: JamesIves/[email protected]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"antd": "^4.16.13",
"history": "^5.1.0",
"lodash-es": "^4.17.21",
"logrocket": "^3.0.1",
"polished": "^4.1.3",
"query-string": "^7.0.1",
"react": "^17.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
interface ImportMetaEnv {
readonly VITE_API_BASE_URL: string;
readonly VITE_GTAG_ID: string;
readonly VITE_LOG_ROCKET_ID: string;
}
5 changes: 5 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import App from '@/App';
import GlobalStyle from '@assets/themes/globalStyle';
import globalTheme from '@assets/themes/globalTheme';
import { ThemeEnum } from '@customTypes/styleTypes';
import LogRocket from 'logrocket';
import React from 'react';
import { ThemeSwitcherProvider } from 'react-css-theme-switcher';
import ReactDOM from 'react-dom';
import { ThemeProvider } from 'styled-components';

if (import.meta.env.PROD) {
LogRocket.init(import.meta.env.VITE_LOG_ROCKET_ID);
}

const themes: { [key in ThemeEnum]: string } = {
[ThemeEnum.DARK]: '/dark-theme.css',
[ThemeEnum.LIGHT]: '/light-theme.css',
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4985,6 +4985,11 @@ lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

logrocket@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-3.0.1.tgz#c746e8df3d5fee999b152975e51db1908357a6f0"
integrity sha512-jOWG+jEzobKVxGytzZ+4KGm2kiMQMRTHab2uDWQyVZcHfEF38BlCH1yjQVY4LCmuQUwZitP9biMzJZnyUQ0dtQ==

loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
Expand Down

1 comment on commit bc2a743

@vercel
Copy link

@vercel vercel bot commented on bc2a743 Oct 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.