-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Sentry integration * Use env var for DSN * Move to `optionalDependencies` * Update docs
- Loading branch information
Showing
9 changed files
with
160 additions
and
64 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,41 @@ | ||
--- | ||
sidebar_icon: bug | ||
--- | ||
|
||
# Sentry | ||
|
||
Sentry is a popular error tracking tool that helps you monitor and fix crashes in real time. It provides you with detailed error reports, so you can quickly identify and resolve issues before they affect your users. | ||
|
||
## Enable Sentry | ||
|
||
1. To enable it you have to first install the optional dependency `@sentry/react`. | ||
|
||
```bash | ||
npm install --save @sentry/react | ||
``` | ||
|
||
2. And then set the `SENTRY_DSN` environment variable in your Zudoku project. | ||
|
||
```bash | ||
|
||
SENTRY_DSN=https://your-sentry-dsn | ||
``` | ||
|
||
## Release management | ||
|
||
However this does not handle release management for you. For that you can [create a custom `vite.config.ts`](./vite-config) and use the `@sentry/vite-plugin` plugin. | ||
|
||
```ts | ||
import { sentryVitePlugin } from "@sentry/vite-plugin"; | ||
import { defineConfig } from "vite"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
sentryVitePlugin({ | ||
authToken: "your-token", | ||
org: "your-org", | ||
project: "your-project", | ||
}), | ||
], | ||
}); | ||
``` |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as Sentry from "@sentry/react"; | ||
import { useEffect } from "react"; | ||
import { | ||
createRoutesFromChildren, | ||
matchRoutes, | ||
useLocation, | ||
useNavigationType, | ||
} from "react-router-dom"; | ||
|
||
export const initSentry = ({ dsn }: { dsn: string }) => { | ||
Sentry.init({ | ||
dsn, | ||
integrations: [ | ||
Sentry.reactRouterV6BrowserTracingIntegration({ | ||
useEffect, | ||
useLocation, | ||
useNavigationType, | ||
createRoutesFromChildren, | ||
matchRoutes, | ||
}), | ||
Sentry.replayIntegration(), | ||
], | ||
}); | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.