Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

"javascript" posts

  • By Nathaniel Okenwa
    Food Glorious Food! Using Location Data in WhatsApp to find nearby healthy restaurants using Twilio and JavaScript. Food Glorious Food! Using Location Data in WhatsApp to find nearby healthy restaurants using Twilio and JavaScript. - Nathaniel Okenwa

    The life of a Developer Evangelist can be very unhealthy. I travel to many different countries and end up ordering fast food to my hotel room far more frequently than I would like. This year, I’m trying to take control of my diet, particularly when on the road. However, I also suffer from decision paralysis. Looking at a long list of restaurants and filtering through them to find restaurants with healthy options can often be tedious and frustrating.

    The amazing thing about being a developer is that I can build tools to solve my problems. Today I’m going to show you how I created a bot to find the closest restaurants serving healthy food, no matter where in the world I am! Follow along to build your own.

    The Twilio API for WhatsApp  makes gathering location data from users easy, enabling us to respond appropriately. Therefore, we’ll use WhatsApp as …

    Read More
  • By Dominik Kundel
    How to move your project to TypeScript - at your own pace Decorative header image "How to move your project to TypeScript - at your own pace"

    We've all been there. You are working on a feature or bug in JavaScript, think you finally got it, run the code and there it is, it basically screams at you: "undefined is not a function". I love JavaScript but as my codebases for projects grow, certain pains appear again and again. From easily refactoring large parts of the codebase to avoiding said "undefined is not a function" and similar bugs, we all encountered pains with JavaScript's approach to types. One of the tools that is trying to help with these pain points and has been growing in popularity recently is TypeScript.

    TypeScript introduces a type system to JavaScript to give you a better understanding of your code and assist you in your development flow. But let's also introduce the elephant in the room early: a lot of us enjoy not having to add types to everything like in …

    Read More
  • By Lizzie Siegle
    How Positive was Your Year with TensorFlow.js and Twilio positive-was-your-year with fireworks

    As 2019 (and the decade) come to an end, it's interesting to reflect on the time spent. What do our text messages say about how positive or negative our time was? This post uses TensorFlow.js to analyze the sentiment of your Twilio text messages for the year.

    tony-hawk-text-sentiment

    Prerequisites

    How does TensorFlow.js help with sentiment analysis?

    TensorFlow makes it easier to perform machine learning (you can read 10 things you need to know before getting started with it here) and for this post we will use one of their pre-trained models and training data. Let's go over some high-level definitions:

    • Convolutional Neural Network (CNN): a neural network often used to classify images and video that takes input and returns output of a …
    Read More
  • By Evangelos Resvanis
    Twilio Autopilot Facebook Messenger Enhancements autopilot-facebook-messenger-enhancements.png

    In this post, I'll explain how to set up and run a Node.js application that augments Twilio Autopilot with Facebook Messenger features that Autopilot doesn’t currently support out-of-the-box.

    This code is just a baseline for your own enhancements. It can be enhanced or changed to create something more complete and robust, expanding to any number of channels and adapting to their APIs.

    Pre-requisites

    1. Clone the Node app repo and set .env values

    You can find the GitHub repo for this post here.

    Then, the following values will be required in your .env file.

    Twilio variables to set …

    Read More
  • By Felistas Ngumi
    How To Send Location Details on WhatsApp in Node JS How To Send Location Details on WhatsApp in Node JS

    WhatsApp is one of the most preferred mobile messaging applications in the world with over 1.5 billion active monthly global users. Since the introduction of WhatsApp business, companies have leveraged this API to engage with their customers to send order or payment notifications, appointment reminders, and shipping alerts among others. One of the key reasons for increased adoption and trust of WhatsApp for users and businesses is the secure end-to-end encryption. Users can share user contacts, documents, locations, and different types of media such as images, audio, and videos. The Twilio API for WhatsApp recently added support for read receipts and location messages. In this tutorial, I will take you through how to send location messages using the Twilio API for WhatsApp.

    Prerequisites

    To complete this tutorial you will need the following:

    1. Twilio Account
    2. Node Version 8 and above

    Getting Started

    In your preferred terminal, run the following commands to …

    Read More
  • By Sam Agnew
    Identifying Phone Number Line Types with Twilio Lookup and Node.js Copy of Generic Blog Header 2 (3).png

    While the Twilio Messaging API won't charge you for attempting to send an SMS to a landline number, identifying the line type of a phone number can be useful for other reasons. A lot of businesses won't let users sign up with VoIP numbers, for example.

    Let's walk through how to identify a phone number's line type with Twilio Lookup and Node.js.

    Setting up

    For this post you will need:

    To install the Twilio npm module, navigate to the directory where you want this code to live and navigate to the directory where you want this code to live and run the following command in your terminal to create a package for this project:

    npm init --yes
    

    The --yes argument just runs through all of the prompts that you would otherwise …

    Read More
  • By Sam Agnew
    Identifying Phone Number Carriers with Node.js and Twilio Lookup Copy of Generic Blog Header 2 (2).png

    Trolls and bad actors sometimes use phone numbers from free online providers to create fake profiles for making spam calls. Twilio's Lookup API helps you identify the carrier behind the phone number to learn which users have real mobile numbers.

    Setting up

    To lookup a phone number you will need:

    To install the Twilio npm module, navigate to the directory where you want this code to live and navigate to the directory where you want this code to live and run the following command in your terminal to create a package for this project:

    npm init --yes
    

    The --yes argument just runs through all of the prompts that you would otherwise have to fill out or skip. Now that we have a package.json for our app, let’s install the Twilio module …

    Read More
  • By Tilde Thurium
    Sending Bulk Emails 3 Ways With Twilio SendGrid And Node.js Sending Bulk Email 3 Ways With Twilio SendGrid and Node.js by Tilde Thurium, Twilio Developer Evangelist

    Sending a single email is great, but one of the big advantages of email is quickly reaching a wider audience. Today I’ll show you three ways to send bulk emails with Node.js and SendGrid. Just for fun, let’s say you’re a JavaScript developer who works at a donut shop. You need a way of letting the customers who have signed up to your email list know when fresh donuts have come straight out of the oven.

    Prerequisites

    Setting up your environment

    First, create your API key from the …

    Read More
  • By Dominik Kundel
    Sending SMS from GitHub Actions Decorative header image "Sending SMS from GitHub Actions"

    At GitHub Universe 2019, GitHub announced that Actions have been moved into General Availability. We are very excited about this launch and as part of it have launched the Twilio SMS for GitHub Action. In this blog post we'll look at how you can get started with that and some use cases for it.

    Getting Started

    You can find the Twilio SMS Action in the GitHub Marketplace. Before using it, you'll need a Twilio account. Sign up for free to get your account details.

    Once you have an account, we'll need two additional things.

    Get a phone number

    If you haven't gotten a phone number yet, head over to the Phone Numbers section of the Twilio Console and select your preferred phone number. Make sure it has SMS capabilities enabled.

    screenshot of Twilio Console with arrow pointing at SMS capability checkbox in Phone Numbers screen

    Once you have that phone number, make sure to note it down somewhere. We'll need it later when …

    Read More
  • By Tilde Thurium
    SMS Affirmations With Twilio And Flic Buttons SMS affirmations with Twilio and Flic buttons

    Earlier this year I built an affirmations button with Twilio Internet of Things. When I’m feeling insecure or anxious (which is often), the button lets me ground myself with a physical gesture and receive a reassuring text message in return.

    A wooden box with a blue button on the top sits on a table. The box has turquoise, teal, and neon yellow stripes.

    The box holding the button looks cool but it's not as portable as I’d like, since it contains a Raspberry Pi. As a Twilio Developer Evangelist, I’m on the road writing code fairly often. I needed something that takes up less space in my luggage.

    Today I’ll show you how to build a more portable affirmations button with Flic.

    What is a Flic button?

    Flic buttons are hardware buttons that are small enough to fit in a pocket. Out of the box, they can be configured to do various things when pushed, such as:

    You can …

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