
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@capraconsulting/sentry-utils-js
Advanced tools
Install the dependency:
npm install --save-exact @capraconsulting/sentry-utils-js
Find your DSN in Sentry under "Settings" -> "Client Keys", to be used in the next snippet.
Initialize Sentry in your application. This should be done as early as possible, preferably before other imports, so that it can catch errors during the rest of initialization.
initSentry({
// Options specified by Sentry, see type Sentry.BrowserOptions.
options: {
release: 'ec1c1c',
environment: '...',
dsn: '...',
},
buildTime: '2019-04-11T00:06+02:00', // Optional
});
The following is a full example of how this can be done:
import {
initSentry,
reportSentryNotEnabled,
} from "@capraconsulting/sentry-utils-js";
import { getConfig } from "./common/config";
const config = getConfig();
if (config.sentryDsn) {
initSentry({
options: {
release: __BUILD_INFO__.commitHash,
environment: config.sentryEnv,
dsn: config.sentryDsn,
},
buildTime: __BUILD_INFO__.appBuildTime,
});
} else {
reportSentryNotEnabled();
}
Capture log events when needed:
import { captureError } from "@capraconsulting/sentry-utils-js";
if (...) {
captureError("Something bad happened")
}
See types for additional capture methods and parameters that can be used.
buildTime
as tag if provided during initializationEvaluate and throttle before sending message to Sentry in case of excessive amount of failures. This will allow for a spike of 4-5 requests, decaying using mean lifetime of 1 minute.
This project uses semantic release to automate releases and follows Git commit guidelines from the Angular project.
FAQs
Utils for monitoring webapps with Sentry
The npm package @capraconsulting/sentry-utils-js receives a total of 16 weekly downloads. As such, @capraconsulting/sentry-utils-js popularity was classified as not popular.
We found that @capraconsulting/sentry-utils-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.