We recommend using v3 SendGrid Node.js, our client library, available on GitHub, with full documentation.
The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see Continue Using V2 in Node.js.
_11// using SendGrid's Node.js Library_11// https://github.com/sendgrid/sendgrid-nodejs_11const sendgrid = require("sendgrid")("SENDGRID_APIKEY");_11const email = new sendgrid.Email();_11_11email.addTo("test@sendgrid.com");_11email.setFrom("you@youremail.com");_11email.setSubject("Sending an email with SendGrid is Fun");_11email.setHtml("and easy to do anywhere, even with Node.js");_11_11sendgrid.send(email);