{"id":14978683,"url":"https://github.com/bjerkio/nestjs-slack","last_synced_at":"2025-04-04T11:08:55.987Z","repository":{"id":36958712,"uuid":"393743114","full_name":"bjerkio/nestjs-slack","owner":"bjerkio","description":"Lightweight library to use Slack in NestJS applications.","archived":false,"fork":false,"pushed_at":"2025-01-16T13:45:04.000Z","size":283,"stargazers_count":52,"open_issues_count":25,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T10:04:18.974Z","etag":null,"topics":["nest","nestjs","slack","slack-api","slack-webhook","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjerkio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2021-08-07T17:03:19.000Z","updated_at":"2025-02-10T14:07:23.000Z","dependencies_parsed_at":"2025-02-06T19:12:16.338Z","dependency_job_id":"3030c844-2376-45e6-b86b-072944d8a201","html_url":"https://github.com/bjerkio/nestjs-slack","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjerkio%2Fnestjs-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjerkio%2Fnestjs-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjerkio%2Fnestjs-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjerkio%2Fnestjs-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjerkio","download_url":"https://codeload.github.com/bjerkio/nestjs-slack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166157,"owners_count":20894652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["nest","nestjs","slack","slack-api","slack-webhook","typescript"],"created_at":"2024-09-24T13:58:11.464Z","updated_at":"2025-04-04T11:08:55.965Z","avatar_url":"https://github.com/bjerkio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.github/logo.svg\" alt=\"Logo\" width=\"150px\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ch3 align=\"center\"\u003enestjs-slack\u003c/h3\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    Lightweight library to use Slack in NestJS applications.\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"#space_invader--usage\"\u003eQuick Start Guide\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/bjerkio/nestjs-slack/issues\"\u003eRequest Feature\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/bjerkio/nestjs-slack/issues\"\u003eReport Bug\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)\n![Release](https://github.com/bjerkio/nestjs-slack/workflows/Release/badge.svg)\n\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/bjerkio/nestjs-slack.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/bjerkio/nestjs-slack/context:javascript)\n[![codecov](https://codecov.io/gh/bjerkio/nestjs-slack/branch/main/graph/badge.svg)](https://codecov.io/gh/bjerkio/nestjs-slack)\n[![Maintainability](https://api.codeclimate.com/v1/badges/95329385d5f02494fd7a/maintainability)](https://codeclimate.com/github/bjerkio/nestjs-slack/maintainability)\n\n**NestjS Slack** helps you sending Slack messages in your [NestJS] application.\nCombined with `slack-block-builder` you can easily create maintainable, testable\nand reusable Slack code declaratively and ready for production.\n\n[nestjs]: https://github.com/nestjs/nest\n\nThis documentation is for v2 of this library. If you are looking for v1\ndocumentation, please check the [v1] branch.\n\n[v1]: https://github.com/bjerkio/nestjs-slack/tree/v1\n\n### :zap: \u0026nbsp; Features\n\n- Used in many production workloads.\n- Building blocks with [slack-block-builder].\n- Supports sending messages directly to Slack Web API.\n- Supports Slack webhooks.\n- Supports Google Logging.\n\n[slack-block-builder]: https://github.com/raycharius/slack-block-builder\n\n### :space_invader: \u0026nbsp; Usage\n\n```shell\n▶ yarn add nestjs-slack\n```\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { SlackModule } from 'nestjs-slack';\n\n@Module({\n  imports: [\n    SlackModule.forRoot({\n      type: 'api',\n      token: '\u003cinsert-token-here\u003e',\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\nTo use `webhook` type, you'll typically use these settings:\n\n```typescript\nSlackModule.forRoot({\n  type: 'webhook',\n  url: '\u003cthe webhook url\u003e',\n}),\n```\n\nYou can also add multiple webhooks, like this:\n\n```typescript\nSlackModule.forRoot({\n  type: 'webhook',\n  channels: [\n    {\n      name: 'dev',\n      url: '\u003ca webhook url\u003e',\n    },\n    {\n      name: 'customers',\n      url: '\u003ca webhook url\u003e',\n    },\n  ],\n}),\n```\n\nYou can also get type assertions if you add a Typescript definition like this:\n\n```typescript\ndeclare module 'nestjs-slack' {\n  type Channels = 'dev' | 'customers';\n}\n```\n\n### Example\n\nYou can easily inject `SlackService` to be used in your services, controllers,\netc.\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { SlackService } from 'nestjs-slack';\n\n@Injectable()\nexport class AuthService {\n  constructor(private service: SlackService) {}\n\n  helloWorldMethod() {\n    this.service.sendText('Hello world was sent!');\n    return 'hello world';\n  }\n}\n```\n\nThe underlying Slack `WebClient` is also available to use on the `SlackService`:\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { SlackService } from 'nestjs-slack';\n\n@Injectable()\nexport class AuthService {\n  constructor(private service: SlackService) {}\n\n  otherSlackWebClientMethod(email) {\n    return await this.service.client.users.lookupByEmail(email);\n  }\n}\n```\n\n### Use with Google Logging\n\n```shell\n▶ yarn add @google-cloud/logging\n```\n\n```typescript\nimport { SlackModule } from 'nestjs-slack';\n\n@Module({\n  imports: [SlackModule.forRoot({ type: 'google' })],\n})\nexport class AppModule {}\n```\n\nWhen `type` is set to `google` the `@google-cloud/logging` package will be used\nto send logs to stdout [according to structured logs][structured-logs].\n\nYou can deploy [gcl-slack] to consume logs from this library.\n\n[structured-logs]: https://cloud.google.com/logging/docs/structured-logging\n[gcl-slack]: https://github.com/bjerkio/gcl-slack\n\n## Contribute \u0026 Disclaimer\n\nWe love to get help 🙏 Read more about how to get started in\n[CONTRIBUTING](CONTRIBUTING.md) 🌳\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjerkio%2Fnestjs-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjerkio%2Fnestjs-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjerkio%2Fnestjs-slack/lists"}