Socket
Socket
Sign inDemoInstall

nest-raven

Package Overview
Dependencies
313
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nest-raven

Sentry Raven Module for Nest Framework


Version published
Maintainers
2
Install size
4.53 MB
Created

Changelog

Source

v10.0.1 (2023-12-03)

<!-- Release notes generated using configuration in .github/release.yml at master -->

What's Changed

:bug: Type: Bug

  • fix: branch name by @9renpoto in https://github.com/mentos1386/nest-raven/pull/634

Other Changes

  • chore(deps-dev): bump @apollo/server from 4.8.1 to 4.9.3 by @dependabot in https://github.com/mentos1386/nest-raven/pull/599
  • chore(deps): update dependency prettier to v3.0.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/600
  • chore(deps): update nest monorepo to v10.2.4 by @renovate in https://github.com/mentos1386/nest-raven/pull/601
  • chore(deps): update dependency @nestjs/apollo to v12.0.9 by @renovate in https://github.com/mentos1386/nest-raven/pull/602
  • chore(deps): update jest monorepo by @renovate in https://github.com/mentos1386/nest-raven/pull/603
  • chore(deps): update nest monorepo to v10.2.5 by @renovate in https://github.com/mentos1386/nest-raven/pull/604
  • chore(deps): update nest monorepo to v10.2.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/606
  • chore(deps): bump graphql from 16.7.1 to 16.8.1 by @dependabot in https://github.com/mentos1386/nest-raven/pull/605
  • remove ts-morph by @9renpoto in https://github.com/mentos1386/nest-raven/pull/608
  • chore(deps): update dependency @commitlint/cli to v17.7.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/609
  • chore(deps): update dependency @types/ws to v8.5.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/611
  • chore(deps): update dependency @types/supertest to v2.0.13 by @renovate in https://github.com/mentos1386/nest-raven/pull/610
  • chore(deps): update dependency @types/supertest to v2.0.14 by @renovate in https://github.com/mentos1386/nest-raven/pull/613
  • chore(deps): update nest monorepo to v10.2.7 by @renovate in https://github.com/mentos1386/nest-raven/pull/614
  • chore(deps): update dependency @types/ws to v8.5.7 by @renovate in https://github.com/mentos1386/nest-raven/pull/615
  • chore(deps): update commitlint monorepo to v17.8.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/616
  • chore(deps-dev): bump @babel/traverse from 7.22.8 to 7.23.2 by @dependabot in https://github.com/mentos1386/nest-raven/pull/618
  • chore(deps): update dependency lint-staged to v15 by @renovate in https://github.com/mentos1386/nest-raven/pull/617
  • test(test): add should report spec by @9renpoto in https://github.com/mentos1386/nest-raven/pull/612
  • chore(deps): update commitlint monorepo to v17.8.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/619
  • chore(deps): update dependency @types/jest to v29.5.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/620
  • chore(deps): update dependency @types/supertest to v2.0.15 by @renovate in https://github.com/mentos1386/nest-raven/pull/621
  • chore(deps): update dependency @types/ws to v8.5.8 by @renovate in https://github.com/mentos1386/nest-raven/pull/622
  • chore(deps): update commitlint monorepo to v18 (major) by @renovate in https://github.com/mentos1386/nest-raven/pull/623
  • chore(deps): update dependency @types/supertest to v2.0.16 by @renovate in https://github.com/mentos1386/nest-raven/pull/627
  • chore(deps): update dependency @nestjs/apollo to v12.0.11 by @renovate in https://github.com/mentos1386/nest-raven/pull/626
  • chore(deps): update nest monorepo to v10.2.8 by @renovate in https://github.com/mentos1386/nest-raven/pull/625
  • chore(deps): update commitlint monorepo to v18.4.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/630
  • chore(deps): update dependency @types/jest to v29.5.8 by @renovate in https://github.com/mentos1386/nest-raven/pull/624
  • chore(deps): update nest monorepo to v10.2.10 by @renovate in https://github.com/mentos1386/nest-raven/pull/629
  • chore(deps): update dependency @types/ws to v8.5.10 by @renovate in https://github.com/mentos1386/nest-raven/pull/628
  • chore: generate release notes by @9renpoto in https://github.com/mentos1386/nest-raven/pull/632
  • chore(deps): update dependency lint-staged to v15.1.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/631
  • fix: remove --workspaces options by @9renpoto in https://github.com/mentos1386/nest-raven/pull/633
  • chore(deps): update dependency @types/jest to v29.5.10 by @renovate in https://github.com/mentos1386/nest-raven/pull/636
  • chore(deps): update dependency prettier to v3.1.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/637

Full Changelog: https://github.com/mentos1386/nest-raven/compare/v10.0.0...v10.0.1

What's Changed

  • chore(deps): pin dependency @apollo/gateway to 2.3.4 by @renovate in https://github.com/mentos1386/nest-raven/pull/531
  • chore(deps): pin dependencies by @renovate in https://github.com/mentos1386/nest-raven/pull/530
  • chore(deps): update dependency @nestjs/apollo to v11.0.4 by @renovate in https://github.com/mentos1386/nest-raven/pull/521
  • chore(deps): pin dependency socket.io-client to 4.6.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/532
  • chore(deps): update dependency @types/node to v18.15.10 by @renovate in https://github.com/mentos1386/nest-raven/pull/533
  • chore(deps): update dependency @types/node to v18.15.11 by @renovate in https://github.com/mentos1386/nest-raven/pull/534
  • chore(deps): update dependency prettier to v2.8.7 by @renovate in https://github.com/mentos1386/nest-raven/pull/535
  • chore(deps): update dependency lint-staged to v13.2.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/536
  • chore(deps): update dependency @apollo/gateway to v2.4.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/537
  • chore(deps): update dependency @nestjs/apollo to v11.0.5 by @renovate in https://github.com/mentos1386/nest-raven/pull/538
  • chore(deps): update commitlint monorepo to v17.6.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/539
  • chore(deps): bump yaml from 2.2.1 to 2.2.2 by @dependabot in https://github.com/mentos1386/nest-raven/pull/540
  • chore(deps): update dependency @apollo/gateway to v2.4.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/541
  • chore(deps): update dependency lint-staged to v13.2.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/542
  • chore(deps): bump engine.io from 6.4.1 to 6.4.2 by @dependabot in https://github.com/mentos1386/nest-raven/pull/543
  • chore(deps): update commitlint monorepo to v17.6.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/545
  • chore(deps): update dependency @apollo/gateway to v2.4.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/546
  • chore(deps): update dependency @apollo/gateway to v2.4.5 by @renovate in https://github.com/mentos1386/nest-raven/pull/547
  • chore(deps): update dependency prettier to v2.8.8 by @renovate in https://github.com/mentos1386/nest-raven/pull/548
  • chore(deps): update dependency @apollo/gateway to v2.4.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/550
  • chore(deps): update dependency @nestjs/apollo to v11.0.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/551
  • chore(deps): update commitlint monorepo to v17.6.5 by @renovate in https://github.com/mentos1386/nest-raven/pull/554
  • chore(deps): update dependency @apollo/gateway to v2.4.7 by @renovate in https://github.com/mentos1386/nest-raven/pull/555
  • chore(deps): update dependency @types/ws to v8.5.5 by @renovate in https://github.com/mentos1386/nest-raven/pull/557
  • chore(deps): update dependency rxjs to v7.8.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/558
  • chore(deps): update dependency socket.io-client to v4.6.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/559
  • chore(deps): update dependency @types/jest to v29.5.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/560
  • chore(deps): bump @apollo/server from 4.5.0 to 4.7.4 by @dependabot in https://github.com/mentos1386/nest-raven/pull/561
  • chore(deps): update dependency @apollo/gateway to v2.4.8 by @renovate in https://github.com/mentos1386/nest-raven/pull/562
  • chore(deps): update dependency @types/node to v18.16.18 by @renovate in https://github.com/mentos1386/nest-raven/pull/563
  • chore(deps): update dependency dotenv to v16.3.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/564
  • chore(deps): update dependency ts-jest to v29.1.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/565
  • chore(deps): update commitlint monorepo to v17.6.6 by @renovate in https://github.com/mentos1386/nest-raven/pull/567
  • chore(deps): update dependency socket.io-client to v4.7.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/568
  • chore(deps): update dependency @types/node to v18.16.19 by @renovate in https://github.com/mentos1386/nest-raven/pull/570
  • chore(deps): update dependency lint-staged to v13.2.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/571
  • chore(deps): update dependency @apollo/gateway to v2.4.9 by @renovate in https://github.com/mentos1386/nest-raven/pull/572
  • chore(deps): update dependency socket.io-client to v4.7.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/573
  • chore(deps): update dependency ts-jest to v29.1.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/574
  • chore(deps): update nest monorepo to v9.4.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/575
  • chore(deps): update dependency @types/jest to v29.5.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/576
  • chore(deps): update dependency prettier to v3 by @renovate in https://github.com/mentos1386/nest-raven/pull/579
  • chore(deps): update dependency @apollo/gateway to v2.5.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/581
  • chore: upgrade @nestjs by @9renpoto in https://github.com/mentos1386/nest-raven/pull/584
  • chore(deps): update commitlint monorepo to v17.6.7 by @renovate in https://github.com/mentos1386/nest-raven/pull/585
  • chore(deps): update nest monorepo to v10.1.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/586
  • chore(deps): update dependency jest to v29.6.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/587
  • chore(deps): update nest monorepo to v10.1.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/588
  • chore(deps): update dependency prettier to v3.0.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/589
  • chore(deps): update dependency socket.io-client to v4.7.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/590
  • chore(deps): update nest monorepo to v10.1.3 by @renovate in https://github.com/mentos1386/nest-raven/pull/591
  • chore(deps): update commitlint monorepo by @renovate in https://github.com/mentos1386/nest-raven/pull/592
  • chore(deps): update dependency lint-staged to v13.3.0 by @renovate in https://github.com/mentos1386/nest-raven/pull/593
  • chore(deps): update dependency prettier to v3.0.2 by @renovate in https://github.com/mentos1386/nest-raven/pull/594
  • chore(deps): update dependency lint-staged to v14 by @renovate in https://github.com/mentos1386/nest-raven/pull/595
  • chore(deps): update jest monorepo by @renovate in https://github.com/mentos1386/nest-raven/pull/596
  • chore(deps): update nest monorepo to v10.2.1 by @renovate in https://github.com/mentos1386/nest-raven/pull/597

Full Changelog: https://github.com/mentos1386/nest-raven/compare/v9.2.0...v10.0.0

  • upgrade @nestjs v8 (#293

Readme

Source

Nest Logo

Sentry Module for Nest framework

NPM Version Package License NPM Downloads Push Github Actions Coveralls

Description

This is a sentry module for Nest.

This package is no longer based on deprecated raven module, but rather on new stable @sentry/node module.

Installation

$ npm i --save nest-raven

Quick Start

Include Module

For Module to work you need to setup Sentry SDK yourself, this should be done in your main.ts file where you initialize the NestJS application.

app.module.ts

@Module({
  imports: [RavenModule],
})
export class ApplicationModule implements NestModule {}

Using Interceptor

app.controller.ts

  @UseInterceptors(new RavenInterceptor())
  @Get('/some/route')
  public async someRoute() {
    ...
  }

With this setup, sentry will pick up all exceptions (even 400 types).

Global

If you want to set up interceptor as global, you have to follow Nest instructions here. Something like this. This only works for Controllers not for Gateways (limitation by NestJS):

app.module.ts

import { APP_INTERCEPTOR } from '@nestjs/core';

@Module({
  imports: [RavenModule],
  providers: [
    {
      provide: APP_INTERCEPTOR,
      useValue: new RavenInterceptor(),
    },
  ],
})
export class ApplicationModule {}
Filters

Sometimes we don't want to catch all exceptions but only 500 or those that we didn't handle properly. For that we can add filters on interceptor to filter out good exceptions.

app.controller.ts

  @UseInterceptors(new RavenInterceptor({
    filters: [
        // Filter exceptions of type HttpException. Ignore those that
        // have status code of less than 500
        { type: HttpException, filter: (exception: HttpException) => 500 > exception.getStatus() }
    ],
  }))
  @Get('/some/route')
  public async someRoute() {
    ...
  }
Transformers

It may be useful to add some extra data to the Sentry's context before sending the payload. Adding some request-related properties for instance. To achieve this we can add scope transformers on interceptor to injecte some data dynamically.

app.controller.ts

  @UseInterceptors(new RavenInterceptor({
    transformers: [
        // Add an extra property to Sentry's scope
        (scope: Scope, context: ExecutionContext) => {
          const req = context.switchToHttp().getRequest<Request>();
          scope.addExtra('important query', req.query.important_query)
          scope.addExtra('important key', 'useful value');
        }
    ],
  }))
  @Get('/some/route')
  public async someRoute() {
    ...
  }
Additional data

Interceptor automatically adds req and req.user (as user) to additional data.

Other additional data can be added for each interceptor.

  • tags
  • extra
  • fingerprint
  • level

app.controller.ts

import { Severity } from '@sentry/node';

  @UseInterceptors(new RavenInterceptor({
    tags: {
      type: 'fileUpload',
    },
    level: Severity.Warning,
  }))
  @Get('/some/route')
  public async someRoute()
    ...
  }
Websockets

Note: Websockets ignore Global interceptors.

It will add ws_client and ws_data extras.

app.gateway.ts

  @UseInterceptors(new RavenInterceptor())
  @SubscribeMessage('message_name')
  public someMessage(client, data: string): string {
    ...
  }
GraphQL

It will add fieldName and args extras.

app.gateway.ts

  @Mutation()
  @UseInterceptors(new RavenInterceptor())
  async upvotePost(@Args('postId') postId: number) {
    ...
  }

Keywords

FAQs

Last updated on 03 Dec 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc