Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including flex-plugin with all npm packages installed. Try it out:

var flexPlugin = require("flex-plugin")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

flex-plugin v3.0.0

Runtime for Flex plugins

Version Downloads License

Flex Plugin

Library to help building Twilio Flex Plugins.


npm install flex-plugin


import { loadPlugin, FlexPlugin } from 'flex-plugin';

class MyPlugin extends FlexPlugin {
  pluginName = 'MyPlugin';

  init(flex, manager) {
    // set up your flex


Visit Twilio Docs for a tutorial on creating your first plugin.


Loading External JS/CSS Files

To load external JS/CSS files into your plugin, we provide two helper methods: loadJS and loadCSS. Use them by calling these methods at the start of plugin initialization.

import { FlexPlugin, loadJS, loadCSS } from 'flex-plugin';

class MyPlugin extends FlexPlugin {
  pluginName = 'MyPlugin';

  init(flex, manager) {

    // set up everything else

The CSS/JS files must be accessible by Twilio's proxy servers. Local files on your desktop are likely inaccessible via these methods, but your stylesheet may be uploaded to Twilio Assets for use here.

External Dependencies

The following NPM packages are defined as external dependencies:


When you build your plugin, these dependencies will not be included in your bundle. Instead, Flex UI will provide them as global for your plugin to use.

To ensure you are using the same version that Flex UI is exposing, leave the version of the React that is specified in your package.json. See React Versions to see the currently supported version.

React Versions

We currently support the following versions:

react          16.5.2
react-dom      16.5.2
redux          3.7.2
react-redux    5.1.0


Make sure to follow the instructions in the main repository to set up the project.

# Install dependencies and link local packages with each other
cd packages/flex-plugin-scripts
npx lerna bootstrap

# Run tests
npm test

# To use your local package in a different project
npm link
# then in a different project
npm link flex-plugin-scripts


Thank you to all the lovely contributors to this project. Please check the main repository to see all contributors.



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free