Adam Reis is a freelance JavaScript consultant and developer based in Wellington, New Zealand. I recently sat down with Elmer Thomas, SendGrid Developer Experience Manager, and Adam to talk about his experience in open source, re-building our Node.js library from scratch, and how the shiny new library helps JavaScript developers using SendGrid quickly integrate email into their apps and products.

SendGrid’s Developer Experience team guides developers from discovery to delight by managing and writing our open source documentation and leading the open source community that has formed around our API library GitHub repositories.

World, meet Adam

Q: What inspired you to become a developer, and what are you up to now?

Adam: I started programming when I was 10 or 11 years old on a MSX computer. During university, my friend and I started a web development business and I stuck to that field even after finishing my Master’s degree in Aerospace Engineering.

Several years ago, I started getting more interested in single page applications and the Node.js ecosystem, which lead me to appreciate Javascript a lot more. I find Javascript very flexible and I like the idea that I can use the same language for both client-side applications for the browser and backend applications for the server. I also like that the language houses a thriving community, and people are actively adding new features and improving things to make it a better language.

Q: You’ve recently been involved in a startup, Hello Club. What is Hello Club, and who uses it?

Adam: Hello Club is an online management portal with a strong (but not exclusive) focus on sports clubs. We help clubs and organisations manage every aspect of their day to day operations, including new member onboarding, automated membership renewals, online payments, event management, court bookings, and more. We also provide full integration with custom-made hardware, which is used for access control and activating court lights.

We started Hello Club when we saw in our own squash club how outdated the technology was and how much manual work was involved in processing paper forms, entering data into multiple databases, etc.—we thought we could do better than that.

Q: What does open source (OS) mean to you, and why do you participate in OS?

Adam: Initially, I didn’t appreciate OS that much. As a web developer focused on creating bespoke software, OS was viewed as a threat to business because we wanted to be paid for building things instead of providing code for free.

My view changed when I made the switch to Javascript. That’s when I started to really appreciate the model and its benefits; people contributing to code, collaborating, and auditing it publicly. The community is creating this living software package that everyone can contribute to.

In the first OS project I worked on, I converted a plug-in for the board game Go into an Angular module. I also started raising issues and actively contributing to other packages that I used a lot, as well as creating my own packages that I needed and which might be useful for the community, like replace-in-file.

Q: How do you use SendGrid?

Adam: I use SendGrid to send transactional emails for both my own projects like Hello Club as well as projects for my clients, including booking reminders, payment reminders, welcome emails, order confirmations, etc. It’s a solid service that was easy to set up and it just worked, so we’ve been very happy with it.

Rebuilding our Node.js library from scratch

Q: What inspired you to rebuild SendGrid’s Node.js library?

Adam: I use it a lot, and I use Node.js as a framework for most of my server projects. As a JavaScript developer, SendGrid’s Node.js library felt to me like it was written by someone who didn’t have much experience with Node.js and Javascript’s newer features, and I saw a lot of things that could be improved.

Elmer: Since SendGrid supports 7 programming languages across our libraries without an expert dedicated to each of those languages, we lean on our amazing OS community to help ensure we are providing an excellent experience in each language. Adam’s story is the realization of that vision at the highest level.

Q: How did you approach rebuilding the library?

Adam: At first, I built a wrapper library around the old library, with a simplified API and I got a lot of good feedback from people using it. There were still some things that could be improved further, so I got in touch with Elmer and we talked about use cases we needed to support and the changes we needed to make, and I just started writing code.

When I want to rebuild something, I often like throwing everything out and starting fresh, to give yourself the best possible starting point and not be bogged down by old code or idea’s.

Q: How does the new Node.js library work?

Adam: We decided to set up the repository for the library as a monorepo, but with individual npm packages for the various components of the library (e.g. the mailer, the API client, helpers, etc.). This allowed us to keep the code in one repository which makes contributing to, maintaining, and testing the library easier, yet have the individual packages split up on npm so users only have to install what they need.

As for the mailer library itself, we dropped support for older Node versions so we could develop the library using modern Javascript without the need for transpilers. The API was designed to be as simple to use as possible.

Sending a simple email should really only be a few lines of code, so that’s what we aimed for when rebuilding the library.

Under the hood, various helper classes are used to construct the underlying data for the mail request and, if needed, the user has full control over this data to leverage all of SendGrid’s more advanced features.

We’ve also introduced a Promise API in addition to the existing Callback API, which makes chaining various asynchronous operations and sending emails a breeze using, for example, async/await.

I love using it for my own products—that was the main motivation for me. When I use something a lot, I want to be happy and comfortable using it. I’m happiest with the general code structure, it’s very clean and promotes coding best practices.

Q: How has the community received this shiny new library?

Elmer: They love it. This is the first of our 7 libraries that has reached over 1,000 stars. It has a lot of subscribers for new releases compared to our other libraries and overall we’ve gotten such great feedback for it.

According to npm, the new library gets over 70,000 downloads per month and it’s continuing to grow. These libraries allow developers using our platform to quickly integrate in the programming language of their choice with access to community support, and take away the need to create and maintain new code to solve common email use cases. In general, we have billions of emails going through these libraries each month so it’s really exciting to have a new experience that people love in their own programming language of choice.

We had a couple requests for extra functionality, like adding TypeScript. We’ve had Benjamin and other community members jump in to make these improvements. It’s just beautiful how things come together in OS.

Q: What tips or advice would you give someone just starting out in OS?

Adam: I recommend first observing how others are doing it, picking up something small that you feel comfortable with, and going from there. Don’t feel offended if the maintainers of the package don’t like your idea or if they reject your PR, just ask for feedback and learn from it.

Be aware that different packages are maintained by different people with different mindsets. Some are quite open to criticism and suggestions, but others not so much. There are some packages I’ve stopped reporting issues simply because of the people being non-receptive and the negative responses I got. I’d say just take it easy and stay respectful.

Elmer: Completely agree. Maintainers need to be open to criticism and accept when other communities are ready to help.

Thanks for your support of SendGrid, Adam! Our community loves your contributions and we look forward to continuing to work with you and the rest of our active open source community to make sending email delightful for developers everywhere. Head over to SendGrid’s Github page to start contributing today! 

Jessy Sweet
Jessy Sweet is a product marketing associate at SendGrid, working cross-functionally to launch products and drive adoption for our Expert Services product line. She's also a big fan of classic literature, drawing, home-brewing beer, and tacos – in no particular order.