Skip to content
Twilio Function templates for different Voice, SMS, Video, Chat, Sync, etc use cases
JavaScript Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__mocks__ Refactor project to be consumable via GitHub API Apr 2, 2019
blank Moves functions to match twilio-run layout. Jul 16, 2019
chat-token feat(templates): add video,chat &sync token templates (#25) Jul 30, 2019
conference Adds simple conference template from Console templates. Aug 1, 2019
forward-call feat(template): add new forward-call template (#24) Jul 29, 2019
forward-message-multiple Remove unnecessary console.log Jul 30, 2019
forward-message-sendgrid Moves functions to match twilio-run layout. Jul 16, 2019
forward-message-sparkpost
forward-message Moves functions to match twilio-run layout. Jul 16, 2019
funlet-echo feat(template): add Echo Funlet (#37) Sep 6, 2019
hello-messaging feat(templates): add basic messaging & voice templates (#27) Jul 30, 2019
hello-voice feat(templates): add basic messaging & voice templates (#27) Jul 30, 2019
hello-world Moves functions to match twilio-run layout. Jul 16, 2019
http-redirect feat(templates): add http-redirect template (#26) Aug 1, 2019
hunt
never-gonna-give-you-up Merge branch 'next' Aug 1, 2019
sync-token feat(templates): add video,chat &sync token templates (#25) Jul 30, 2019
temp-storage feat(template): add temp storage function template (#45) Sep 3, 2019
test feat(templates): add video,chat &sync token templates (#25) Jul 30, 2019
video-token fix: remove console.log from test Jul 31, 2019
.gitignore Adds code coverage Jul 26, 2017
.nvmrc build(nvm): bump Node.js version to 8.10 Jul 15, 2019
.travis.yml Initial commit. Jul 5, 2017
CODE_OF_CONDUCT.md Initial commit. Jul 5, 2017
LICENSE Initial commit. Jul 5, 2017
README.md docs(readme): update README with Temp Storage function description (#48) Sep 7, 2019
package-lock.json Bump eslint-utils from 1.3.1 to 1.4.2 Aug 26, 2019
package.json Updates twilio and jest-cli to latest Jul 31, 2019
templates.json feat(template): add temp storage function template (#45) Sep 3, 2019

README.md

Twilio Function Templates

Build Status

Twilio Functions are a serverless environment to build and run Twilio applications so you can get to production faster. You provide the Node.js code to perform the task you need and Twilio runs it. You can read more about Twilio Functions and how to use them in the introductory blog post.

This repo

This repo is intended to be a collection of useful Twilio Functions that are tested and documented. The intention is that you can take any of these Functions and drop them into a project, confident they will work. Whether you are a developer looking for a particular building block or a builder who justs needs a particular Function. These templates are also available through twilio-run new inside the twilio-run CLI.

Usage

Each Function lives in its own directory within this repo. To use the code, copy the contents of the main Function file to your Twilio Function. Make sure you read the Function README so that you know which environment variables to set and the parameters the Function takes when you make HTTP requests to it.

Available Functions

This is the list of Functions available in this repo:

Todo

  • Forward message to email with other API providers
  • Generate Twilio Client access token
  • Voicemail
  • Inbound calls for SIP registration
  • Outbound calls for SIP registration
  • Translate webhook from application/x-www-form-urlencoded into application/json and forward on to another service

Please add ideas if you have them.

Contribute

Pull requests and new Functions are accepted. To make a contribution, follow these steps:

  1. Fork this repository ( https://github.com/twilio-labs/function-templates/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Install

This project and Twilio Functions use Node.js version 8.10. I recommend using nvm if you need to install multiple versions of Node.js. Clone or download the project, use the correct version of Node.js and install the dependencies:

nvm use
npm install

Tests

Tests are written with Jest. Run them with:

npm test

License

MIT © Phil Nash

You can’t perform that action at this time.