Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-link-sentry

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-sentry - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

lib/excludeGraphQLFetch.d.ts

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

## [2.1.0](https://github.com/DiederikvandenB/apollo-link-sentry/compare/v2.0.2...v2.1.0) (2021-02-04)
### Features
* add helpers to exclude GraphQL fetch breadcrumbs ([#264](https://github.com/DiederikvandenB/apollo-link-sentry/issues/264)) ([a8fa792](https://github.com/DiederikvandenB/apollo-link-sentry/commit/a8fa792c7050c57f4cb552ebd91e6375b7213b8a))
### Chores
* **deps-dev:** bump @sentry/browser and @sentry/minimal to v6 ([a223504](https://github.com/DiederikvandenB/apollo-link-sentry/commit/a2235046b73ee15a232289a39d429aec642e8d05))
### [2.0.2](https://github.com/DiederikvandenB/apollo-link-sentry/compare/v2.0.1...v2.0.2) (2021-01-15)

@@ -7,0 +19,0 @@

1

lib/index.d.ts
export { Operation } from './Operation';
export * from './excludeGraphQLFetch';
export * from './SentryLink';
//# sourceMappingURL=index.d.ts.map

@@ -7,3 +7,4 @@ "use strict";

Object.defineProperty(exports, "Operation", { enumerable: true, get: function () { return Operation_1.Operation; } });
tslib_1.__exportStar(require("./excludeGraphQLFetch"), exports);
tslib_1.__exportStar(require("./SentryLink"), exports);
//# sourceMappingURL=index.js.map

10

package.json
{
"name": "apollo-link-sentry",
"version": "2.0.2",
"version": "2.1.0",
"license": "MIT",

@@ -40,5 +40,5 @@ "author": "Diederik van den Burger <diederikvandenburger@tab.capital>",

"@apollo/client": "^3.2.3",
"@sentry/browser": "^5.26.0",
"@sentry/minimal": "^5.26.0",
"@sentry/types": "^5.26.0",
"@sentry/browser": "^6.0.4",
"@sentry/minimal": "^6.0.4",
"@sentry/types": "^6.0.4",
"@types/jest": "^26.0.14",

@@ -59,4 +59,4 @@ "@typescript-eslint/eslint-plugin": "^3.1.0",

"ts-jest": "^26.4.1",
"tsc-watch": "~4.2.9",
"tslib": "^2.0.3",
"tsc-watch": "~4.2.9",
"typescript": "^4.0.3",

@@ -63,0 +63,0 @@ "zen-observable": "^0.8.15"

@@ -126,4 +126,40 @@ # Apollo Link Sentry

Furthermore, much of the data you are sending to Sentry can include (sensitive) personal information. This might lead you to violating the terms of the GDPR. Use Sentry's `beforeBreadrcrumb` function to filter out all sensitive data.
Furthermore, much of the data you are sending to Sentry can include (sensitive) personal information. This might lead you to violating the terms of the GDPR. Use Sentry's `beforeBreadcrumb` function to filter out all sensitive data.
## Exclude redundant `fetch` breadcrumbs
By default, Sentry attaches all fetch events as breadcrumbs. Since this package tracks GraphQL requests as breadcrumbs,
they would show up duplicated in Sentry.
1. Disable the default integration for fetch requests. Note that this is only recommended if you **only** use GraphQL requests in your application. The default integration can be disabled like this:
```js
Sentry.init({
...,
defaultIntegrations: [
new Sentry.BrowserTracing({ traceFetch: false }),
],
});
```
2. Use the `beforeBreadcrumb` option of Sentry to filter out the duplicates.
The helpers in this package recognize every breadcrumb of category `fetch` where the URL contains `/graphql` as a GraphQL request.
```js
import { excludeGraphQLFetch } from 'apollo-link-sentry';
Sentry.init({
...,
beforeBreadcrumb: excludeGraphQLFetch,
})
```
If you have a custom wrapper, use the higher order function:
```js
import { withoutGraphQLFetch } from 'apollo-link-sentry';
Sentry.init({
...,
beforeBreadcrumb: withoutGraphQLFetch((breadcrumb, hint) => { ... }),
})
```
## FAQ

@@ -149,14 +185,2 @@ - **I don't see any events appearing in my Sentry stream**

```
- **GraphQL operations are also logged as fetch breadcrumbs**
- Sentry by default attaches all fetch events as breadcrumbs. This means that there are two ways to ensure GraphQL operations appear but once:
1. Disable the default integration for fetch requests. Note that this is only recommended if you **only** use GraphQL requests in your application. The default integration can be disabled like this:
```js
Sentry.init({
dsn: '',
defaultIntegrations: [
new Sentry.Integrations.Breadcrumbs({ fetch: false }),
],
});
```
2. Otherwise, it will be possible to use the `beforeBreadcrumb` option of Sentry to filter out the duplicates. This feature is not yet implemented in this package, but it is on the roadmap (see below).

@@ -168,4 +192,2 @@ ## Caveats

## Roadmap / notes
- Provide wrapper for Sentry's beforeBreadcrumb to filter out fetch requests
- Caveat: people using `unfetch`?
- Write best practice scenario:

@@ -172,0 +194,0 @@ - setting `includeError` true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc