nylas
    Preparing search index...

    Nylas Attachments API

    The Nylas Attachments API allows you to retrieve metadata and download attachments.

    Index

    Constructors

    Properties

    apiClient: APIClient

    Methods

    • Type Parameters

      • T

      Parameters

      • __namedParameters: DestroyParams

      Returns Promise<T>

    • Parameters

      • __namedParameters: FindParams<void>

      Returns Promise<Buffer<ArrayBufferLike>>

    • Parameters

      • __namedParameters: FindParams<void>

      Returns Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

    • Download the attachment data

      This method returns a Web ReadableStream which can be used to stream the attachment data. This is particularly useful for handling large attachments efficiently, as it avoids loading the entire file into memory. In Node.js, convert it with Readable.fromWeb() when a NodeJS.ReadableStream is required.

      Parameters

      • __namedParameters: DownloadAttachmentParams & Overrides

      Returns Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

      The ReadableStream containing the file data.

    • Download the attachment as a byte array

      Parameters

      • __namedParameters: DownloadAttachmentParams & Overrides

      Returns Promise<Buffer<ArrayBufferLike>>

      The raw file data

    • Download the attachment data as a Node.js readable stream.

      This is a Node.js convenience wrapper around Attachments.download. Use Attachments.download directly in Fetch-native runtimes, such as Cloudflare Workers, where Web ReadableStreams are the standard stream primitive.

      Parameters

      • __namedParameters: DownloadAttachmentParams & Overrides

      Returns Promise<ReadableStream>

      The Node.js readable stream containing the file data.