{"_id":"@andeanwide/nestjs-rollbar","name":"@andeanwide/nestjs-rollbar","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@andeanwide/nestjs-rollbar","version":"1.0.0","description":"A reusable rollbar module for NestJS","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"tsc","test":"jest --verbose","test:watch":"jest --watch","test:coverage":"jest --coverage"},"keywords":["nestjs","rollbar","reusable","module"],"author":{"name":"mik3dev"},"license":"MIT","dependencies":{"@nestjs/common":"^9.0.0","@nestjs/core":"^9.0.0","reflect-metadata":"^0.2.2","rollbar":"^2.26.4","rxjs":"^7.8.1"},"devDependencies":{"@nestjs/testing":"^11.0.5","@types/jest":"^29.5.14","@types/node":"^22.10.10","jest":"^29.7.0","ts-jest":"^29.2.5","ts-loader":"^9.5.2","typescript":"^5.7.3"},"peerDependencies":{"@nestjs/common":"^9.0.0","@nestjs/core":"^9.0.0"},"_id":"@andeanwide/nestjs-rollbar@1.0.0","gitHead":"29266047b6130c73b38bf861ac9596086094a902","_nodeVersion":"18.19.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-o7fAmhEvk/WAnzm7NQru5zaumYr4+E2Qr9rIhzpU+VFcDD/8if9LlFsX91pd2y4l3b0Qw89ZrceoPbiKtSM0tA==","shasum":"807c4ea548a85d73218acb825cc49d840f7a4228","tarball":"https://registry.npmjs.org/@andeanwide/nestjs-rollbar/-/nestjs-rollbar-1.0.0.tgz","fileCount":14,"unpackedSize":14475,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD54GsmchH6K2KhwhTTQc6fXjVLm/JVKrtA96zSe2X3BwIgFZayvLOssn3jxIvv6DkLiQN3eC0rVFyhxGuixmnpNBk="}]},"_npmUser":{"name":"andeanwide","email":"soporte@andeanwide.com"},"directories":{},"maintainers":[{"name":"andeanwide","email":"soporte@andeanwide.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-rollbar_1.0.0_1737745226578_0.7168760047262006"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-24T19:00:26.462Z","1.0.0":"2025-01-24T19:00:26.771Z","modified":"2025-01-24T19:00:27.043Z"},"maintainers":[{"name":"andeanwide","email":"soporte@andeanwide.com"}],"description":"A reusable rollbar module for NestJS","keywords":["nestjs","rollbar","reusable","module"],"author":{"name":"mik3dev"},"license":"MIT","readme":"# NestJS Rollbar Integration\n\nA NestJS module that provides seamless integration with Rollbar for error tracking and logging.\n\n## Installation\n\n```bash\nnpm install @andeanwide/nestjs-rollbar rollbar\n```\n\n## Features\n\n- Global error tracking with Rollbar\n- Async configuration support\n- TypeScript support\n- Environment-aware configuration\n- Context tracking for better error tracing\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { RollbarModule } from '@andeanwide/nestjs-rollbar';\n\n@Module({\n  imports: [\n    RollbarModule.register({\n      accessToken: 'your-rollbar-access-token',\n      environment: 'production', // or 'development'\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Async Configuration\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport { RollbarModule } from '@andeanwide/nestjs-rollbar';\n\n@Module({\n  imports: [\n    RollbarModule.registerAsync({\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService) => ({\n        accessToken: configService.get('ROLLBAR_ACCESS_TOKEN'),\n        environment: configService.get('NODE_ENV'),\n      }),\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Using the RollbarService\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { RollbarService } from '@andeanwide/nestjs-rollbar';\n\n@Injectable()\nexport class YourService {\n  constructor(private readonly rollbar: RollbarService) {}\n\n  async doSomething() {\n    try {\n      // Your code here\n    } catch (error) {\n      this.rollbar.error(error);\n    }\n\n    // Log information\n    this.rollbar.log('Operation completed successfully');\n\n    // Log info level messages\n    this.rollbar.info('User logged in', { userId: '123' });\n  }\n}\n```\n\n## Configuration Options\n\nThe module accepts all standard Rollbar configuration options plus:\n\n- `accessToken` (required): Your Rollbar project access token\n- `environment` (optional): The environment name ('development' or 'production')\n\nFor a complete list of Rollbar configuration options, see the [Rollbar documentation](https://docs.rollbar.com/docs/nodejs).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License","readmeFilename":"README.md"}