Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
sendgrid-client-redos-fixed
Advanced tools
This package is part of a monorepo, please see this README for details.
This client library is used by the other Twilio SendGrid service packages to make requests to the Twilio SendGrid v3 Web API. You can also use it independently to make custom requests to the Twilio SendGrid v3 Web API and other HTTP APIs.
Grab your API Key from the Twilio SendGrid UI.
Do not hardcode your Twilio SendGrid API Key into your code. Instead, use an environment variable or some other secure means of protecting your Twilio SendGrid API Key. Following is an example of using an environment variable.
Update the development environment with your SENDGRID_API_KEY, for example:
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs. Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it.
npm install --save @sendgrid/client
You may also use yarn to install.
yarn add @sendgrid/client
Please see USAGE.md for all endpoint examples for the Twilio SendGrid v3 Web API.
const client = require('@sendgrid/client');
client.setApiKey(process.env.SENDGRID_API_KEY);
const request = {
method: 'GET',
url: '/v3/api_keys'
};
client.request(request)
.then(([response, body]) => {
console.log(response.statusCode);
console.log(body);
})
client.setDefaultHeader('User-Agent', 'Some user agent string');
// or
client.setDefaultHeader({'User-Agent': 'Some user agent string'});
client.setDefaultRequest('baseUrl', 'https://api.sendgrid.com/');
// or
client.setDefaultRequest({baseUrl: 'https://api.sendgrid.com/'});
You can overwrite the promise implementation you want the client to use. Defaults to the ES6 Promise
:
global.Promise = require('bluebird');
const {Client} = require('@sendgrid/client');
const sgClient1 = new Client();
const sgClient2 = new Client();
sgClient1.setApiKey('KEY1');
sgClient2.setApiKey('KEY2');
All updates to this library are documented in our CHANGELOG and releases.
We encourage contribution to our libraries (you might even score some nifty swag), please see our CONTRIBUTING guide for details.
Please see our troubleshooting guide for common library issues.
@sendgrid/client is maintained and funded by Twilio SendGrid, Inc. The names and logos for @sendgrid/client are trademarks of Twilio SendGrid, Inc.
If you need help installing or using the library, please check the Twilio SendGrid Support Help Center.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
FAQs
Twilio SendGrid NodeJS API client
The npm package sendgrid-client-redos-fixed receives a total of 0 weekly downloads. As such, sendgrid-client-redos-fixed popularity was classified as not popular.
We found that sendgrid-client-redos-fixed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.