SendGrid in a Next.js API route: server-only key, @sendgrid/mail
Updated solution skillNew
Send mail from a Next.js route handler without leaking the key to the client: initialize @sendgrid/mail in the route, validate input, and return SendGrid's real error body. Not for different error…