Skip to content
Skip to main content

Nylas Node.js SDK v8.1.2

sdksnode
  • attachments.downloadNodeStream() — A new convenience helper that returns a Node.js Readable stream, making attachment downloads work cleanly with stream.pipeline(), file writes, S3 uploads, and HTTP response streaming. The existing attachments.download() continues to return a Web ReadableStream<Uint8Array> for Fetch-native runtimes such as Cloudflare Workers (which already requires nodejs_compat). The download() JSDoc is also updated to accurately describe the Web Stream return type. See Download an attachment.

  • fields query parameter on messages.send()nylas.messages.send() now accepts an optional queryParams: { fields } argument. Pass MessageFields.INCLUDE_HEADERS or the new MessageFields.INCLUDE_BASIC_HEADERS to receive a headers array ([{ name, value }]) on the returned message object. The query parameter is forwarded on both the JSON and multipart (large attachment) request paths. See Send a message.

The v8 native Fetch migration moved Response.body to the Web Streams API, which is the right cross-runtime primitive but adds friction for Node.js apps that pipe attachment bytes into files, S3, or downstream HTTP responses. downloadNodeStream() gives you a Node-native path without changing the existing Web Stream API or introducing a new runtime requirement. And if you’ve needed to inspect message headers (such as Message-Id or threading headers) immediately after sending, the fields query parameter returns them on the send response so you don’t need a follow-up GET /messages/{id} call.