Newton's Preposterous Miscalculation


    1.1.6 • Public • Published

    Nylas Email

    Nylas Email (<nylas-email>) is part of the Nylas Components library that lets you build event/calendar applications in minutes. Use Nylas Email with your Nylas account or by passing in your own JSON data.

    Nylas Email is currently in active development. Want to contribute? Find out how!

    Nylas Email

    Table of Contents


    In your JavaScript application, you can install Nylas Email with:

    • npm npm i @nylas/components-email
    • Yarn yarn add @nylas/components-email

    Alternatively, on an html page, you can load the Email using a script tag:

          <!-- Import the script from CDN -->
          <script src=""></script>

    For both installation options, in the body of your page, you can instantiate the email component with <nylas-email></nylas-email>.

    Using It in Your App

    All Nylas components have two ways of displaying data to your end-user:

    1. Fetching data directly from Nylas
    2. Passing in your own data

    Fetching data directly from Nylas


    If you haven't registered for a Nylas account yet, you can do so at Once there, head to the Components tab and create a new Email component.

    You'll be guided through the component setup and be given the option to tie your component to a thread. Review the Email Documentation.

    Allowed domains

    During the setup process, you'll be prompted to provide a list of allowed domains. Be sure to add any domains you'll be testing your app on, including localhost, and any staging and production URLs you might use.

    Passing in your own data

    Nylas Email can be used as a UI on top of any thread data that you provide. Threads should follow the Nylas thread object standard.

    The property to use for this is thread. You can pass in a JSON thread with an array of messages.

      const staticThread =
                {"email":"","name":"Phil Renaud"},
                {"email":"","name":"Review requested"}
                {"email":"","name":"Mostafa Rashed"}
              "snippet":"Hi, Welcome to Nylas",
              "subject":"Hello from Nylas",
          "snippet":"Hi, Welcome to Nylas",
          "subject":"Hello from Nylas",

    Then pass the array into your component using any JavaScript.

    <nylas-email thread={thread}>
    <nylas-email thread_id={thread_id}>
    <nylas-email message={message}>
    <nylas-email message_id={message_id}>

    You can also use plain JavaScript as an attribute.

    document.querySelector("nylas-email").thread = staticThread;
    document.querySelector("nylas-email").thread_id = staticThreadID;
    document.querySelector("nylas-email").message = staticMessage;
    document.querySelector("nylas-email").message_id = staticMessageID;


    Nylas Email allows for several properties that affect the layout and functionality of your component. You can find a complete list of properties within our Documentation for Nylas Email

    Events and Callbacks

    You can listen to certain user events from your application by adding an event listener to your component.

    For example, you can listen for a threadClicked event with the following code:

      .addEventListener("threadClicked", (event) => {
        let { detail } = event;
        console.log("thread clicked: ", detail.thread);

    A list of emitted events is available on our Documentation for Nylas Email


    Please refer to our Contributing Guidelines for information about how to get involved. We welcome bug reports, questions, and pull requests.

    1. Git clone
    2. Run yarn install
    3. Run yarn start; your browser will load http://localhost:8000 and show you a list of available running components


    yarn cy:open will launch our end-to-end tests in a browser tests will automatically be run on push from push.yaml

    Additional Documentation




    npm i @nylas/components-email

    DownloadsWeekly Downloads






    Unpacked Size

    632 kB

    Total Files


    Last publish


    • krisgardiner
    • nylas-admin
    • philrenaud
    • poojaguggari
    • sourcesoft
    • hghamilton
    • aaron-nylas
    • ozsivanov
    • mrashed-dev