Create a CLI Chatbot With the ChatGPT API and Node.js

ChatGPT has taken the world by storm, and this week, OpenAI released the ChatGPT API. I’ve spent some time playing with ChatGPT in the browser, but the best way to really get on board with these new capabilities is to try building something with it. With the API available, now is that time.

This was inspired by Greg Baugues’s implementation of a chatbot command line interface (CLI) in 16 lines of Python. I thought I’d start by trying to build the same chatbot but using JavaScript.

Better Two Factor Authentication Experiences With WebOTP

Two-factor authentication (2FA) is a great way to improve the security of user accounts in an application. It helps protect against common issues with passwords, like users picking easily guessable passwords or reusing the same password across multiple sites. There are different ways to implement two-factor authentication, including SMS, an authenticator application, and WebAuthn.

SMS is the most widely used and won’t be going away, so it falls on us as developers to do our best to build the best SMS 2FA experience for our users. The WebOTP API is one way we can help reduce friction in the login experience and even provide some protection against phishing.

How to Use the Bitly API in Ruby

Link shortening has been around for a long time, and Bitly is arguably the king of link shorteners. It has support for shortening long URLs as well as custom short links, custom domains, and metrics to track how each link is performing.

For those of us with the power of code at our fingertips, Bitly also has an API. With the Bitly API, you can build all of the functionality of Bitly into your own applications and expose it to your users. In this post, you’ll learn how to use the Bitly Ruby gem to use the Bitly API in your Ruby applications.

Permissions on the Web Suck

I am a fan of progressive web apps and the powers that they bestow on web developers to build the next generation of applications. We can write web applications that work offline, download large files in the background, send push notifications, and much more. I was so excited about push notifications on the web that I wrote a whole talk about it in 2015 and was fortunate enough to give it in a bunch of places around the world.

But perhaps I was a little too prescient with that talk title, "The web is getting pushy." Web applications themselves are getting pushy and now I see tweets like this:

VS Code Extension: Ngrok for VS Code

Over the Easter weekend, a four-day weekend characterized by lockdowns all over the world, I decided to use the extra time I had at home to start a new project and learn a new skill. By the end of the weekend, I was proud to release my first VSCode extension: ngrok for VSCode.

What’s That?

ngrok is a command-line tool built by Alan Shreve that you can use to expose your localhost server with a publicly available URL. It’s great for sharing access to an application running on your own machine, testing web applications on mobile devices, or testing webhook integrations. For example, I’m a big fan of using ngrok to test my webhooks when I am working with Twilio applications.

How to Start a Node.js Project

Sometimes I write blog posts to remind myself what I’ve learned and sometimes I write them because someone else shares something and I want to remember that better. This post is one of the latter.

Starting a Node.js project

Usually, when I start a new Node.js project I use npm to generate my initial project.