{"id":22382583,"url":"https://github.com/wavezync/nestjs-pgboss","last_synced_at":"2026-01-31T06:05:51.399Z","repository":{"id":252741810,"uuid":"827890235","full_name":"wavezync/nestjs-pgboss","owner":"wavezync","description":"State of Art PG Boss integration with NestJS","archived":false,"fork":false,"pushed_at":"2026-01-18T20:22:10.000Z","size":172,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T04:06:43.109Z","etag":null,"topics":["nestjs","nestjs-backend","nestjs-pgboss","pg-boss","pgboss","postgresql","postgresql-database"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavezync.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-12T15:47:37.000Z","updated_at":"2026-01-18T20:22:02.000Z","dependencies_parsed_at":"2024-08-22T10:32:40.894Z","dependency_job_id":"7e69e502-c8a7-486c-ad08-eb121f68aefc","html_url":"https://github.com/wavezync/nestjs-pgboss","commit_stats":null,"previous_names":["wavezync/nestjs-pgboss"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/wavezync/nestjs-pgboss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavezync%2Fnestjs-pgboss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavezync%2Fnestjs-pgboss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavezync%2Fnestjs-pgboss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavezync%2Fnestjs-pgboss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavezync","download_url":"https://codeload.github.com/wavezync/nestjs-pgboss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavezync%2Fnestjs-pgboss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28931094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nestjs","nestjs-backend","nestjs-pgboss","pg-boss","pgboss","postgresql","postgresql-database"],"created_at":"2024-12-05T00:13:32.712Z","updated_at":"2026-01-31T06:05:51.383Z","avatar_url":"https://github.com/wavezync.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@wavezync/nestjs-pgboss`\n\n\u003cp align=\"center\"\u003e\n    Use \u003ca href=\"https://github.com/timgit/pg-boss\" target=\"_blank\"\u003epg-boss\u003c/a\u003e in your Nest.js app!\n\u003cp align=\"center\"\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://github.com/wavezync/nestjs-pgboss/actions/workflows/build.yaml\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/wavezync/nestjs-pgboss/build.yaml?branch=main\" alt=\"Build Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@wavezync/nestjs-pgboss\"\u003e\n      \u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/%40wavezync%2Fnestjs-pgboss\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/wavezync/nestjs-pgboss/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-green\" alt=\"License\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n```bash\nnpm install pg-boss @wavezync/nestjs-pgboss\n```\n\n## Usage\n\n### Setup\n\nTo begin using `@wavezync/nestjs-pgboss`, initialize the root module:\n\n```ts\nimport { PGBossModule } from \"@wavezync/nestjs-pgboss\";\n\n// app.module.ts\n@Module({\n  imports: [\n    PgBossModule.forRootAsync({\n      imports: [ConfigModule],\n      useFactory: async (configService: ConfigService) =\u003e ({\n        connectionString: configService.get\u003cstring\u003e('DATABASE_URL'),\n      }),\n      inject: [ConfigService],\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n#### Schedule a job using `PgBossService`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { PgBossService } from '@wavezync/nestjs-pgboss';\n\n@Injectable()\nexport class JobSchedulerService {\n  constructor(private readonly pgBossService: PgBossService) {}\n\n  async scheduleJob() {\n    await this.pgBossService.scheduleJob('my-job', { key: 'value' });\n  }\n}\n\n```\n\n#### Access `boss` Directly\n\nYou can access the `PgBoss` instance directly via `pgBossService.boss`\n\n#### Handle jobs using the `@Job` decorator\n\n```ts\nimport { Injectable, Logger } from '@nestjs/common';\nimport { Job } from '@wavezync/nestjs-pgboss';\nimport { JobWithMetadata } from 'pg-boss';\n\ninterface MyJobData {\n  id: number;\n  name: string;\n}\n\n@Injectable()\nexport class MyJobHandler {\n  private readonly logger = new Logger(MyJobHandler.name);\n\n  @Job('my-job')\n  async handleMyJob(jobs: JobWithMetadata\u003cMyJobData\u003e[]) {\n    this.logger.log(`Processing ${jobs.length} job(s)`);\n  }\n}\n\n```\n\n#### Handle cron jobs using the `@CronJob` decorator\n\n```ts\nimport { Injectable, Logger } from '@nestjs/common';\nimport { PgBossService, CronJob } from '@wavezync/nestjs-pgboss';\n\n@Injectable()\nexport class MyCronJobService {\n  private readonly logger = new Logger(MyCronJobService.name);\n\n  @CronJob('my-cron-job', '0 * * * *', { priority: 1 })\n  async handleCron() {\n    this.logger.log('Executing cron job: my-cron-job');\n  }\n}\n\n```\n\n## Test\n\n```bash\n# unit tests\n$ npm run test\n\n```\n\n## License\n\n`@wavezync/nestjs-pgboss` is [MIT licensed](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavezync%2Fnestjs-pgboss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavezync%2Fnestjs-pgboss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavezync%2Fnestjs-pgboss/lists"}