Better Programming

Advice for programmers.

Follow publication

Member-only story

Build an SMS Web App With JavaScript and Cloud APIs

Text fun facts to your users!

Tyler Hawkins
Better Programming
Published in
3 min readJan 28, 2022

--

Fun Facts SMS Demo App
Fun Facts SMS Demo App

SMS is a powerful way to connect with your users. Businesses all over the world use SMS texts to send appointment reminders, shipping notifications, customer satisfaction surveys, and more. For countries or customers with slower internet speeds, SMS can even function as a viable alternative to something like an in-app chat feature.

In this article, we’ll demonstrate the power of SMS and showcase just how easy it is to get started. Together we’ll build a “Fun Fact of the Day” web app that allows users to enter their phone number to receive an SMS text with a fun fact. We’ll provide this functionality using the SMS API from Infobip, a cloud communications platform.

Let’s get started!

Demo App Overview

Demo app: Enter your phone number to receive an SMS text
Demo app: Enter your phone number to receive an SMS text

Our demo app is built with Node.js and Express on the backend and simple HTML, CSS, and JavaScript on the frontend.

Fun Facts SMS Demo App
Demo app: Text message successfully sent

Users can enter their phone number into this minimal interface and then click the submit button to receive a text triggered by the Infobip API.

Text message with a fun fact about penguins
Text message with a fun fact about penguins

Simple as that!

Let’s walk through how we built this. We’ll include a few code snippets throughout the rest of this article, but feel free to check out the GitHub repo for the full example code.

Creating the Signup Form

Let’s start with the frontend code for the signup form. The form is constructed with your typical HTML form elements: <form>, <label>, <input>, and <button>:

--

--

Tyler Hawkins
Tyler Hawkins

Written by Tyler Hawkins

Staff software engineer. Continuous learner. Educator. http://tylerhawkins.info

Responses (1)

Write a response