This library allows you to quickly and easily use the SendGrid Web API via Node.js.
BREAKING CHANGE as of 2016.06.14
Version 3.X.X brings you full support for all Web API v3 endpoints. We have the following resources to get you started quickly:
Thank you for your continued support!
All updates to this library is documented in our CHANGELOG.
- Node.js version 0.10, 0.12 or 4
- The SendGrid service, starting at the free level
Setup Environment Variables
Update your environment with your SENDGRID_API_KEY.
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.envecho "sendgrid.env" >> .gitignoresource ./sendgrid.env
Add the following to your
Install sendgrid-nodejs and its dependencies:
You can also install sendgrid locally with the following command:
npm install sendgrid
var helper = mailfrom_email = "email@example.com"to_email = "firstname.lastname@example.org"subject = "Hello World from the SendGrid Node.js Library"content = "text/plain" "some text here"mail = from_email subject to_email contentvar sg =var requestBody = mailvar request = sgrequestmethod = 'POST'requestpath = '/v3/mail/send'requestbody = requestBodysg
General v3 Web API Usage
var sg =// GET Collectionvar request = sgrequestmethod = 'GET'requestpath = '/v3/api_keys'sg
If you are intersted in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.
How to Contribute
We encourage contribution to our libraries, please see our CONTRIBUTING guide for details.
sendgrid-nodejs is guided and supported by the SendGrid Developer Experience Team.
sendgrid-nodejs is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-nodejs are trademarks of SendGrid, Inc.