
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
sendgrid-rest
Advanced tools

Quickly and easily access any RESTful or RESTful-like API.
If you are looking for the SendGrid API client library, please see this repo.
All updates to this library are documented in our CHANGELOG.
You need to have a API key to use the app. To configure the API key in the environment variables follow these steps.
SENDGRID_API_KEY='<YOUR_API_KEY>';
npm install sendgrid-rest
GET /your/api/{param}/call
var Client = require('sendgrid-rest').Client
var client = new Client()
var request = client.emptyRequest()
var param = 'myparam'
request.host = 'api.example.com'
request.method = 'GET'
request.path = '/your/api/' + param + '/call'
client.API(request, function (response) {
console.log(response.statusCode)
console.log(response.body)
console.log(response.headers)
})
POST /your/api/{param}/call with headers, query parameters and a request body.
var Client = require('sendgrid-rest').Client
var client = new Client()
var request = client.emptyRequest()
request.host = 'api.example.com'
request.headers['Authorization'] = 'Bearer XXXXXX'
request.queryParams['limit'] = 100
request.queryParams['offset'] = 0
request.method = 'POST'
var param = 'myparam'
request.path = '/your/api/' + param + '/call'
requestBody = {
'some': 0,
'awesome': 1,
'data': 3
}
request.body = requestBody
client.API(request, function (response) {
console.log(response.statusCode)
console.log(response.body)
console.log(response.headers)
})
Following is an example using SendGrid. You can get your free account here.
First, update your environment with your SENDGRID_API_KEY.
You can copy the .env_example file located in the "examples" folder to .env in your project's root.
cp examples/.env_sample .env
Once you have edited the file and added your API Key, you can add the variable to your environment:
source .env
Here is the full working code.
To run the example:
node examples/example
======= Library Usage Documentation
Tests can be run through a Docker container which is defined in the docker-compose.yml file.
To run the tests, simply run docker-compose up.
If you are interested in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.
We encourage contribution to our libraries, please see our CONTRIBUTING guide for details.
nodejs-http-client is guided and supported by the SendGrid Developer Experience Team.
nodejs-http-client is maintained and funded by SendGrid, Inc. The names and logos for nodejs-http-client are trademarks of SendGrid, Inc.
FAQs
HTTP REST client, simplified for Node.js.
The npm package sendgrid-rest receives a total of 32,428 weekly downloads. As such, sendgrid-rest popularity was classified as popular.
We found that sendgrid-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.