Coder Social home page Coder Social logo

anthonydelgado / sdk-starter-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twiliodeved/sdk-starter-node

0.0 1.0 0.0 89 KB

Demo application showcasing Twilio API usage in Node.js

Home Page: https://www.twilio.com/docs

License: MIT License

JavaScript 56.38% CSS 24.66% HTML 18.96%

sdk-starter-node's Introduction

Twilio

Twilio SDK Starter Application for Node.js

Build Status

This sample project demonstrates how to use Twilio APIs in a Node.js web application. Once the app is up and running, check out the home page to see which demos you can run. You'll find examples for Chat, Video, Sync, and more.

Let's get started!

Configure the sample application

To run the application, you'll need to gather your Twilio account credentials and configure them in a file named .env. To create this file from an example template, do the following in your Terminal.

cp .env.example .env

Open .env in your favorite text editor and configure the following values.

Configure account information

Every sample in the demo requires some basic credentials from your Twilio account. Configure these first.

Config Value Description
TWILIO_ACCOUNT_SID Your primary Twilio account identifier - find this in the console here.
TWILIO_API_KEY Used to authenticate - generate one here.
TWILIO_API_SECRET Used to authenticate - just like the above, you'll get one here.

A Note on API Keys

When you generate an API key pair at the URLs above, your API Secret will only be shown once - make sure to save this information in a secure location, or possibly your ~/.bash_profile.

Configure product-specific settings

Depending on which demos you'd like to run, you'll need to configure a few more values in your .env file.

Config Value Product Demo Description
TWILIO_CHAT_SERVICE_SID Chat Like a database for your Chat data - generate one in the console here
TWILIO_SYNC_SERVICE_SID Sync (Preview) Like a database for your Sync data - generate one in the console here
TWILIO_NOTIFICATION_SERVICE_SID Notify (Preview) You will need to create a Notify service - generate one here

Configuring Notify

You will need to create a Notify Service through the Twilio Console, and add at least one credential on the Mobile Push Credential screen (such as Apple Push Notification Service or Firebase Cloud Messaging for Android) to send notifications using Notify.

Run the sample application

Now that the application is configured, we need to install our dependencies from npm.

npm install

Now we should be all set! Run the application using the node command.

npm start

Your application should now be running at http://localhost:3000/.

Home Screen

Check your config values, and follow the links to the demo applications!

Running the SDK Starter Kit with ngrok

If you are going to connect to this SDK Starter Kit with a mobile app (and you should try it out!), your phone won't be able to access localhost directly. You'll need to create a publicly accessible URL using a tool like ngrok to send HTTP/HTTPS traffic to a server running on your localhost. Use HTTPS to make web connections that retrieve a Twilio access token.

ngrok http 3000

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

sdk-starter-node's People

Contributors

jefflinwood avatar kwhinnery avatar smendes avatar well1791 avatar hortega avatar devidliik avatar joliveros avatar dprothero avatar pkamp3 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.