Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
sentry-react
Advanced tools
<Sentry />
sentry-react
offers a <Sentry />
component that instantiates Sentry for your
React application.
npm install sentry-react
oryarn add sentry-react
Mount <Sentry />
around your React application, typically alongside your
context providers.
import { render } from 'react-dom';
import Sentry from 'sentry-react';
import { App } from './components';
render(
<Sentry>
<App />
</Sentry>,
document.getElementById('root'),
);
In addition to the default <Sentry />
component export, you can also import:
<MockSentrySdk />
to mock the Sentry SDK during unit tests.useSentrySdk()
to get the Sentry SDK.
const { captureError } = useSentrySdk();
The Sentry
component shares all the same properties as Sentry's init
function. Additionally, you can use the following props:
ErrorBoundaryFallback
Type: FunctionComponent<FallbackRenderParams>
optional
The ErrorBoundaryFallback
component will be mounted as a replacement to your
children
prop when and if an error is thrown.
beforeErrorBoundaryCapture
Type:
(scope: Scope, error: Error | null, componentStack: string | null) => void
optional
This callback fires before the error is captured by Sentry, allowing you to add tags or context using the scope.
errorBoundaryDialogOptions
Type: ReportDialogOptions
optional
The error boundary dialog options are passed into the Sentry report dialog.
These options are ignored if showErrorBoundaryDialog
is false
.
For the definition of ReportDialogOptions
, see
@sentry/browser
's helpers.ts
file.
onErrorBoundaryError
Type: (error: Error, componentStack: string, eventId: string) => void
optional
This callback fires when the error boundary encounters an error.
onErrorBoundaryMount
Type: VoidFunction
optional
This callback fires when the error boundary mounts.
onErrorBoundaryReset
Type (optional):
(
error: Error | null,
componentStack: string | null,
eventId: string | null
) => void
This callback fires if and when the resetError
prop is called from the
ErrorBoundaryFallback
component.
onErrorBoundaryUnmount
Type (optional):
(
error: Error | null,
componentStack: string | null,
eventId: string | null
) => void`
This callback fires when the error boundary unmounts.
showErrorBoundaryDialog
Type: boolean
optional
The showErrorBoundaryDialog
prop determines if a Sentry report dialog should
be rendered on error.
user
Type: User
optional
By default, the user will have their IP address automatically assigned by
Sentry. While you can associate any key-value pairs to the user
prop, Sentry
recommends id
, email
, ip_address
, and username
.
To integrate Sentry with FullStory, go to the Sentry website, under organization
settings, Security & Privacy, Data Scrubbing, and add fullStoryUrl
to "Global
Safe Fields."
FAQs
A React component for instantiating Sentry
The npm package sentry-react receives a total of 1 weekly downloads. As such, sentry-react popularity was classified as not popular.
We found that sentry-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.