Gathering detailed insights and metrics for @ntegral/nestjs-sendgrid
Gathering detailed insights and metrics for @ntegral/nestjs-sendgrid
Gathering detailed insights and metrics for @ntegral/nestjs-sendgrid
Gathering detailed insights and metrics for @ntegral/nestjs-sendgrid
npm install @ntegral/nestjs-sendgrid
Typescript
Module System
Node Version
NPM Version
HTML (74.61%)
TypeScript (12.38%)
JavaScript (7.63%)
CSS (5.37%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
23 Stars
1 Commits
11 Forks
3 Watchers
13 Branches
1 Contributors
Updated on Jun 11, 2024
Latest Version
1.0.0
Package Id
@ntegral/nestjs-sendgrid@1.0.0
Unpacked Size
156.53 kB
Size
28.58 kB
File Count
72
NPM Version
6.14.4
Node Version
13.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Injectable SendGrid client for your nestjs projects
@ntegral/nestjs-sendgrid
implements a module, SendGridModule
, which when imported into
your nestjs project provides a SendGrid client to any class that injects it. This
lets SendGrid be worked into your dependency injection workflow without having to
do any extra work outside of the initial setup.
1npm install --save @ntegral/nestjs-sendgrid @sendgrid/mail
The simplest way to use @ntegral/nestjs-sendgrid
is to use SendGridModule.forRoot
1import { Module } from '@nestjs-common'; 2import { SendGridModule } from '@ntegral/nestjs-sendgrid'; 3 4@Module({ 5 imports: [ 6 SendGridModule.forRoot({ 7 apiKey: 'my_secret_key', 8 }), 9 ], 10}) 11export class AppModule {}
The async way @ntegral/nestjs-sendgrid
is to use SendGridModule.forRootAsync
1import { Module } from '@nestjs-common'; 2import { SendGridModule } from '@ntegral/nestjs-sendgrid'; 3import { ConfigModule } from '@ntegral/nestjs-config'; 4import { ConfigService } from '@ntegral/nestjs-config'; 5 6@Module({ 7 imports: [ 8 SendGridModule.forRootAsync({ 9 imports: [ConfigModule], 10 useFactory: async (cfg:ConfigService) => ({ 11 apiKey: cfg.get('SENDGRID_API_KEY'), 12 }), 13 inject: [ConfigService], 14 }) 15 ] 16}) 17 18export class AppModule {}
You can then inject the Stripe client into any of your injectables by using a custom decorator
1import { Injectable } from '@nestjs/common'; 2import { InjectSendGrid, SendGridService } from '@ntegral/nestjs-sendgrid'; 3 4@Injectable() 5export class AppService { 6 public constructor(@InjectSendGrid() private readonly client: SendGridService) {} 7}
Asynchronous setup is also supported
1import { Module } from '@nestjs-common'; 2import { ConfigModule } from '../common/config/config.module'; 3import { ConfigService } from '../common/config/config.service'; 4import { SendGridModule } from '@ntegral/nestjs-sendgrid'; 5 6@Module({ 7 imports: [ 8 StripeModule.forRootAsync({ 9 imports: [ConfigModule], 10 inject: [ConfigService], 11 useFactory: (cfg: ConfigService) => ({ 12 apiKey: cfg.get('sendgrid_api_key'), 13 }), 14 }), 15 ], 16}) 17export class AppModule {}
I would greatly appreciate any contributions to make this project better. Please make sure to follow the below guidelines before getting your hands dirty.
git checkout -b my-branch
)Distributed under the MIT License. See LICENSE
for more information.
Copyright © 2019 Ntegral Inc.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More