Skip to content

Commit

Permalink
Filter non web-client error (#278)
Browse files Browse the repository at this point in the history
* Filter non web-client error

* bump version

* update change log
  • Loading branch information
ayinloya authored Jul 1, 2024
1 parent ac97dd4 commit 24aa7ce
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.4] - 2024-07-01

### Added

- Added workflow_dispatch to deploy
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "example",
"private": true,
"version": "1.3.3",
"version": "1.3.4",
"type": "module",
"main": "server.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smileid/web",
"version": "1.3.3",
"version": "1.3.4",
"description": "A collection of SmileID browser clients and components",
"main": "index.js",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/embed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smileid/embed",
"version": "1.3.3",
"version": "1.3.4",
"description": "Self Hosted Integration for Smile Identity on the Web",
"private": true,
"main": "inline.js",
Expand Down
19 changes: 18 additions & 1 deletion packages/embed/src/js/script.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
import * as Sentry from '@sentry/browser';

Sentry.init({
beforeSend(event) {
// Check if the error originates from the library's source files
if (event.exception && event.exception.values) {
const isLibraryError = event.exception.values.some((exception) => {
return exception.stacktrace.frames.some((frame) =>
frame.filename.includes('inline/src'),
);
});

// If the error is from the library, send it to Sentry
if (isLibraryError) {
return event;
}
}
// Otherwise, do not send the error
return null;
},
dsn: 'https://[email protected]/4507143981236224',
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: ['smileid-web-client'],
behaviour: 'drop-error-if-exclusively-contains-third-party-frames',
behaviour: 'drop-error-if-contains-third-party-frames',
}),
],
tracesSampleRate: 0.05,
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-camera-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smile_identity/smart-camera-web",
"version": "1.3.3",
"version": "1.3.4",
"description": "WebComponent for smartly capturing images on the web, for use with SmileIdentity",
"main": "smart-camera-web.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smileid/signature-pad",
"version": "1.3.3",
"version": "1.3.4",
"private": "true",
"exports": {
".": "./index.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smileid/web-components",
"version": "1.3.3",
"version": "1.3.4",
"private": "true",
"exports": {
".": "./index.js",
Expand Down

0 comments on commit 24aa7ce

Please sign in to comment.