Build the future of communications.
Start building for free
  • By Dominik Kundel
    Creating a virtual photo booth using Twilio, WhatsApp & Cloudinary ueiPKYUnYGNhEDFMWyk3KgruLhuc2iu1GEA5JD3lUxeZL84E1GmuH5w4UOejAXzZdj7NK7_owncknk3e9-IPSlaGEvt19TclzBKxFkx2eU-el2cwJrNfPqXCldzqrW08DCEreTNV

    If you've ever been to Berlin, chances are high that you've seen multiple photo booths in bars and on the street. Berlin and photo booths just belong together. This year for JSConf EU we wanted to build our own virtual photo booth, powered by Twilio for WhatsApp. In this post, we'll look at how we built the digital part of the photo booth using Twilio and Cloudinary.

    Let's build a purely digital version of this photo booth where when a person sends in an image, we'll perform some manipulations on that picture and send it back.

    Prerequisites

    Before we get started, make sure you have the following:

    If you prefer to view the next steps as a video to follow along, make sure to check out this ...

    Read More
  • By Dominik Kundel
    When Not to Use Lock Files with Node.js Decorative header image "When Not to Use Lock Files with Node.js"

    Probably one of the most common situations that you encounter when debugging a problem is the "works on my machine" scenario. This is often the result of different underlying dependencies on the system of the person with the bug and your own system. As a result both yarn and npm introduced so called "lock files" at one point that keep track of the exact versions of your dependencies. However, when you are developing a package that will be published to npm, you should avoid using such lock files. In this blog post we'll discuss why this is the case.

    Quick Summary (tl;dr)

    Lock files are super useful if you build an application like a web server. However, if you publish a library or CLI to npm, lock files are never published. Meaning your users and you might use different versions of dependencies if you use lock files. 

    What's a ...

    Read More
  • By Dominik Kundel
    A Guide to Node.js Logging Decorative header image "A guide to Node.js logging"

    When you start developing in JavaScript one of the first things you'll probably learn is how to log things to the console using console.log. If you search on how to debug JavaScript you'll find hundreds of blog posts and StackOverflow articles pointing you to "simply" console.log it. And because it's such a common practice we even started having linter rules like no-console to make sure we don't leave accidental log statements in our production code. But what if we actually want to log something intentionally to provide more information?

    In this blog post we'll look at various situations where you want to log info, what the difference between console.log and console.error in Node.js is, and how you can ship logging in your libraries without cluttering the users console.

    console.log(`Let's go!`);
    

    Theory First: Important Details for Node.js

    While you are able to ...

    Read More
  • By Dominik Kundel
    Send Images and Other Media via WhatsApp Using Node.js Decorative header image for "Send Media Messages using WhatsApp & Node.js"

    The Twilio API for WhatsApp allows you to not only send text-based messages to WhatsApp numbers but also send and receive media messages. This allows you to send images (JPG, JPEG, PNG), audio files and even PDFs up to 5MB. Let's see how we can do this using Node.js.

    If you prefer watching a video tutorial instead, check out this video on our YouTube channel:

     

    First Things First

    Before we get started, make sure you have:

    If you want to try this out make sure to set up a new project by running:

    mkdir whatsapp-media-messages
    cd whatsapp-media-messages
    npm init -y
    

    Sending Your First Media Message

    Install the twilio helper library by ...

    Read More
  • By Dominik Kundel
    How to build a CLI with Node.js atZ3n9vMFjjXDl_XxDtL_FCRSOt6EF0d8LnbMRCCJQUesMme8lzdGpCyMr4-wt1nlIGuoT29EI_tkVpuD_P2mxzbfhbn-ZPcqmZ5QCY_nM9d4ywWEYQxKYc9mjxUnp_uFJzMOMnr

    Command-line interfaces (CLIs) built in Node.js allow you to automate repetitive tasks while leveraging the vast Node.js ecosystem. And thanks to package managers like npm and yarn, these can be easily distributed and consumed across multiple platforms. In this post we'll look at why you might want to write a CLI, how to use Node.js for it, some useful packages and how you can distribute your new CLI.

    Why create CLIs with Node.js

    One of the reasons why Node.js got so popular is the rich package ecosystem with over 900,000 packages in the npm registry. By writing your CLIs in Node.js you can tap into this ecosystem including it's big amount of CLI-focused packages. Among others:

    Read More
  • By Dominik Kundel
    SMS Forwarding and Responding Using Twilio and JavaScript WQYMYFAg9558AJMa_xQENKB7Zr6UuQVlw4ABsN9882jjATPJBRI39lv9fjpcrt_Aid547rgTfEYhfbEaSbTJmiNSmji-NICPQdBfBcsIOgwQ9pHUMS5iHbM3KflKPi5UIt5cKV9z

    There are a variety of reasons why you sometimes don't want to give out your phone number to people but still want to receive SMS and be able to reply. Maybe you are trying to sell something on the internet, maybe you want to set up a way for people to report code of conduct violations at an event, or maybe you just don't trust the newly met person that asked for your number. In the past I showed how you can quickly set up a message forwarding with practically no coding using TwiML Bins. However, it doesn't let you respond using that number.

    Let's take a look at how we can change that using Twilio Functions. If you prefer to follow along a video, check out this tutorial on our YouTube channel.

     

    Creating a Twilio Function

    Before we get started, make sure you have a Twilio account. Sign up ...

    Read More
  • By Dominik Kundel
    Building an Intelligent Coffee Order System with Twilio Autopilot P4A1qTECQKaGBhSwn-22LCyNgalovf-fVLjm_M5jVRszMsp0rGdQR_XV2GJfH5_9FLVUDfZXz4zmcJwijBa_y0DjM29Q4vpOY8-KX2vNWxd6Xltzs4MnQfwCLbsTvI0ijvMLunzU

    Wouldn't it be great if you could save daily a few, maybe awkward, interactions with other humans and let bots take care of it instead? However, often these bots are not too intelligent when it comes to interacting with you. In this blog post we'll learn how we can build a smarter SMS bot in just a few minutes.

    In a previous blog post we talked about how we love to serve coffee at conferences and other events "Twilio-Style" by allowing attendees to order their coffee via SMS. If you haven't read the blog post, make sure to check out Serving Coffee with Twilio Programmable SMS and React. Unfortunately we had a fairly rudimentary way of handling the orders. Until now.

    Let's see how we can upgrade this existing project using Twilio Autopilot to be truly intelligent.

    If you would prefer to see how this works by watching a video ...

    Read More
  • By Dominik Kundel
    Locally developing and debugging Twilio Functions NBpDHJPAhyHu7zd92fFyQWXn8QO04Oy6h7CiwMBzvWU_6OEeuWMnW_8lz66Z8v02VcZ7H-FyB52kVksmFgpae_1YceCHz6mXLjDBnli9zjEPYW-XG_Nv8wc62RlRIn7bERhkPerd

    Twilio is all about HTTP endpoints & webhooks. From responding to incoming SMS, to controlling the flow of a voice call to blocking unwanted chat messages with an onMessageSend webhook, chances are that you'll end up writing an HTTP endpoint for the Twilio product you're interacting with. Twilio Functions allow you to write and host those endpoints directly in the Twilio cloud while relying on the power of Node.js.

    What if you want to develop these functions with your IDE or editor of choice and run them locally? What if something goes wrong and you want to use your debugger to dive deeper into it? For this reason I built twilio-run, a command-line tool that allows you to run your Twilio Functions in your local environment. 

    Let's dive into how it works, and how it can help your development flow with Twilio.

    Please Note:

    This tool is open source ...

    Read More
  • By Dominik Kundel
    Building an npm search bot with WhatsApp and Twilio kk5Dl1j4QkccAXbXCEnRAYuDNbn7ssPj4I1_3DthB-Zq74ljlPjtMhAPrVf0X4v_jyjts5QuqALUX2sQkvPR8waZASn0h-qK9vc8LqFOmOVFam9BHN02s3uG1mOYcKcXhJo3EALd

    The npm ecosystem is vast by now with almost 750k packages published. Naturally, you’ll find yourself often trying to look up a package you don’t remember. The npm search is great for that but what if you just want to quickly look up a package on the go? Let’s build a bot that can look up the packages for us using Twilio’s API for WhatsApp integration.

    Requirements

    Just like with Twilio Programmable SMS we’ll need a webhook that will respond to incoming HTTP requests with every message sent to our WhatsApp bot. The webhook then has to reply with TwiML to reply to these messages.

    We’ll build our webhook using Twilio Functions. This allows us to write Node.js code and host it in a serverless function directly on Twilio.

    To get started make sure you have:

    Read More
  • By Dominik Kundel
    Building a chat with Twilio, lit-html, Parcel and TypeScript eRdunQ0Ne_pDmUihXu946Engcm5amvSnpC09bTnmPp4Fp3Zz9mtr88dnW1b3cmDyCoPnDTQaStBcb3ZNhGMb1RSHEF9NLOmdrFKg_5AbBJHCnMNwhODx1AyJ-Z66c5KqqrhbEgfO

    When building a web application you often reach a place where you’ll have to render a similar element multiple times and as efficiently as possible. That’s when a lot of web developers start reaching out to frameworks and libraries such as React, Vue or Angular. But what if we only want to do efficient templating and don’t want the tooling & code overhead of these libraries?

    One library that aims to solve this problem is lit-html by the Polymer team. It uses browser-native functionality such as <template/> tags and tagged template literals to create efficient templating. Let’s take a look at how we can use it by building a Twilio Chat application with lit-html.

    Prerequisites

    Before we get started make sure that you have Node.js and npm installed. Since we’ll be using Twilio Chat at one point in this application, you want to ...

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.