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 Treasure Porth
    Send an SMS with Vue and Twilio Functions smsvue.png

    In this article you’ll learn how to send an SMS using Vue 3 on the front end and Twilio Functions on the backend. Because Vue is a front end framework, you’ll use Twilio functions to handle sending a message and to avoid exposing your Twilio credentials.

    To demonstrate these concepts, you’ll build a Vue app with a button. When the button is clicked, a POST request will be made to your API. The API will send a message and then return a response back to your Vue application.

    Prerequisites

    In order to follow along with this tutorial, you’ll need these tools and technologies:

    Create your API with Twilio Functions

    Create a new Function Service

    Twilio Functions …

    Read More
  • By Dhruv Patel
    Build a GPT-3 Discord Chatbot with Node.js Gpt-3 Discord Bot Header

    OpenAI’s GPT-3 is a language model that offers a multifaceted “text in, text out” interface that can be applied to virtually any task. It can produce code, stories, recipes, and more. The engine is capable of doing anything - it can even do your homework for you! OpenAI's GPT-3 engine is also a remarkable tool for chatbots since its output text is indistinguishable from human text. A fitting integration with this is Discord chatbots.

    In recent years, Discord has become the central messaging platform for communities especially with the help of Discord bots. Through Discords extensive API, developers are able to build robust bots that are capable of various actions such as automating tasks and chatting with users.

    With the gaining traction of both of these technologies, I decided to combine them to build an intelligent but fun chatbot.

    In this article you’ll learn how to use …

    Read More
  • By Dhruv Patel
    How to Send Recurring Emails in Node.js with SendGrid Header

    When building applications, there are often times when you need to create and run background tasks that run on a schedule such as checking for updates or backing up data.

    There are many ways of scheduling recurring tasks in Node.js such as using Crontab or cloud based extensions. Another approach to scheduling recurring tasks is through npm packages such as node-cron and node-schedule which provide flexible cron scheduling to Node.js through libraries without the need to rely on infrastructure.

    In this tutorial, you’ll learn how to use node-schedule and SendGrid to schedule recurring emails.

    Prerequisites

    Here is what you will need to follow along with this article:

    Configure your environment

    Start off by logging into your SendGrid account and heading to the API Keys section. Click the blue “Create API Key” button …

    Read More
  • By Heather Hargreaves
    Integrate Discord and Sentiment Analysis with Twilio Flex Integrate Discord and Sentiment Analysis with Twilio Flex

    In this post, you will learn how to set up a Discord bot connected to Flex so agents can chat directly with customers on that platform, while pulling in sentiment analysis of previous messages. You will learn how to use IBM’s Tone Analyzer API and Segment to calculate a user’s sentiment from their texts in a Discord channel.

    Originally this project was created as a part of the 2021 Solutions Engineering Hackathon. We pared our original project down to the following for simplicity’s sake and to distill the project’s essence, which is to help contact center teams interact with customers directly in Discord. To see the original contents of the project, see this Github repo.

    To see a demo of the original project and background on why we chose Discord, check out this quick video below.

    Prerequisites

    For this project, you will need:

    • A Twilio account. Sign up for …
    Read More
  • By Miguel Grinberg
    Add a Realtime Viewer Count to your Twilio Live Stream Add a Realtime Viewer Count to your Twilio Live Stream

    An important aspect of running a Twilio Live streaming experience is to track your viewership. But how do you do that? There are many different ways to do it, and the best method to use will depend on your needs and your technology stack.

    Are you ready to learn how to count your livestream viewers? In this article I’ll show you a few possible implementations with varying levels of complexity and flexibility.

    Requirements

    This article does not have any requirements beyond having some familiarity with the Twilio Live product. If you haven’t worked with Twilio Live before, I recommend that you follow an introductory tutorial first. My colleague Mia Adjei wrote a Twilio Live tutorial using Express.js, and I have also written one using the Twilio serverless platform, both of which show you how to build a complete livestreaming project step by step.

    To apply what you learn …

    Read More
  • By Lizzie Siegle
    Detect Objects in a Serverless Twilio Video App with TensorFlow.js header-tf-obj-det

    Object detection is a computer vision technique for locating instances of objects in media such as images or videos. This machine learning (ML) method can be applied to many areas of computer vision, like image retrieval, security, surveillance, automated vehicle systems and machine inspection. Read on to learn how to detect objects in a Twilio Programmable Video application using TensorFlow.js.

    object detection gif

    Setup

    To build a Twilio Programmable Video application, we will need:

    Download this GitHub repo and then create a file named .env in the top-level directory with the following contents, replacing the XXXXX placeholders with the values that apply …

    Read More
  • By Miguel Grinberg
    Deploy your Vue.js Application with the Twilio Serverless Toolkit Deploy your Vue.js Application with the Twilio Serverless Toolkit

    When you are ready to deploy your Vue.js application you are faced with the problem of selecting a hosting platform. For this there are lots of options, but many require you to set up and manage your own server or container.

    In this short tutorial I want to introduce you to the Twilio Runtime, a serverless hosting platform that when paired with the Twilio Serverless Toolkit makes deploying your front end application as easy as typing yarn deploy on your terminal.

    Requirements

    To work on this tutorial you will need the following items:

    Read More
  • By Ashley Boucher
    How to Handle File Uploads from Node.js to Express fileuploads.png

    Recently I was developing a CLI in Node.js that would help make the process of writing articles in Markdown easier for my team. The flow required that a local .md file be parsed, formatted, converted to .docx, and then uploaded to Google Drive as a Google Doc file, all by running one command from the terminal.

    I approached this project in a few different ways, hoping initially that I could use serverless functions to handle the backend. I hit a lot of dead ends on this route, and eventually decided to build an Express server that I would ultimately host on Heroku.

    To upload the .docx file contents from my CLI to a secure backend endpoint, where it would then be uploaded to the user’s authenticated Google Drive, I needed a way to POST multipart/form-data directly from Node.js (without a browser). This requires several third party libraries, and it …

    Read More
  • By Miguel Grinberg
    Deploy your React Application with the Twilio Serverless Toolkit Deploy your React Application with the Twilio Serverless Toolkit

    When you are ready to deploy your React application you are faced with the problem of selecting a hosting platform. Here you have a variety of options, many of them requiring you to set up servers or containers.

    In this short tutorial I want to introduce you to the Twilio Runtime, a serverless hosting platform that when paired with the Twilio Serverless Toolkit makes deploying your React application as easy as typing yarn deploy on your terminal.

    Requirements

    To work on this tutorial you will need the following items:

    Read More
  • By Mia Adjei
    Build a Livestreaming Application with Twilio Live and Express Build a Livestreaming Application with Twilio Live and Express

    Twilio Live is finally here! If you have ever wanted to build your own livestreaming application, now is your chance.

    In this tutorial, you will learn how to build a livestreaming application and share your live video feed with your friends, followers, and maybe even the world. For this project, you'll be using Node.js and Express to build the server side of the application, and vanilla JavaScript on the client side.

    Let's get started!

    Prerequisites

    • A free Twilio account. (If you register here, you'll receive $10 in Twilio credit when you upgrade to a paid account!)
    • Node.js v14+ and npm installed on your machine.
    • ngrok

    What you will build

    In this tutorial, you will be creating an application that allows a person to livestream video and audio from their device to people who have the link to the stream. The Express server you'll build will handle both the streamer …

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