
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@snapshot-labs/snapshot-sentry
Advanced tools
`snapshot-sentry` is an npm package that contains the Sentry setup files and configurations for Snapshot backend projects. It simplifies the process of setting up Sentry for error tracking in any Snapshot service.
snapshot-sentry
is an npm package that contains the Sentry setup files and configurations for Snapshot backend projects.
It simplifies the process of setting up Sentry for error tracking in any Snapshot service.
yarn add @snapshot-labs/snapshot-sentry
Set the following env variables:
SENTRY_DSN
(required)SENTRY_TRACE_SAMPLE_RATE
(Optional, default to 0.01
)Import the library in your root file
import { initLogger, fallbackLogger } from '@snapshot-labs/snapshot-sentry'
Init sentry just after creating your express instance, before any middleware
const app = express();
initLogger(app);
Set the fallthrough error handler after all controllers, but before any other error middleware
fallbackLogger(app);
Note: If you have a catch-all route, set fallbackLogger()
before it.
All uncaught errors, with code >= 500, will be handled automatically by Sentry. See Capture exception for how to handle caught exceptions.
Import the library in your root file
import { initLogger } from '@snapshot-labs/snapshot-sentry'
Init sentry, as soon as possible to catch all errors.
initLogger()
See Capture exception for how to handle exceptions.
To capture an exception, use the capture
function:
import { capture } from '@snapshot-labs/snapshot-sentry'
try {
throw new Error('Ooops, someting went wrong');
} catch (e: any) {
// Send the error to sentry
capture(e)
}
You can also pass additional context data to the capture function:
import { capture } from '@snapshot-labs/snapshot-sentry'
let url = '';
try {
url = getUrlFromSomewhere('argOne')
throw new Error('Ooops, someting went wrong');
} catch (e: any) {
// Send the error to sentry
capture(e, { contexts: { input: { url: url } } })
}
When sentry is disabled, the capture
function will fallback to a simple console.log
, so no code change will be required when toggling this library on/off.
Snapshot-sentry is open-sourced software licensed under the © MIT license.
FAQs
`snapshot-sentry` is an npm package that contains the Sentry setup files and configurations for Snapshot backend projects. It simplifies the process of setting up Sentry for error tracking in any Snapshot service.
We found that @snapshot-labs/snapshot-sentry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.