This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import * as Flex from '@twilio/flex-ui'; | |
import { FlexPlugin } from '@twilio/flex-plugin'; | |
const PLUGIN_NAME = 'TestPlugin'; | |
export default class TestPlugin extends FlexPlugin { | |
constructor() { | |
super(PLUGIN_NAME); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const twilio = require('twilio'); | |
const accountSid = ''; | |
const authToken = ''; | |
const chatService = ''; | |
const channelSid = process.argv[2] || ''; | |
if (channelSid === '') { | |
console.error('A channelSid must be provided. `node closeChannel.js <channelSid>`'); | |
return process.exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { IconButton, withTheme } from '@twilio/flex-ui'; | |
const containerStyles = { | |
padding: '20px' | |
} | |
const paragraphStyles = { | |
marginBottom: '20px' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import * as FlexWebChat from "@twilio/flex-webchat-ui"; | |
import PreEngagementForm from './PreEngagementForm'; | |
class App extends React.Component { | |
state = {}; | |
constructor(props) { | |
super(props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {combineReducers} from 'redux'; | |
import { WebchatReducer } from '@twilio/flex-webchat-ui' | |
const rootReducer = (function () { | |
const reducers = {flex: WebchatReducer }; | |
return { | |
addReducer: function (slice, reducer) { | |
reducers[slice] = reducer; | |
}, | |
combinedReducers: function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// view instructions about the twilio-flex-token-validator here: https://www.npmjs.com/package/twilio-flex-token-validator | |
const JWEValidator = require('twilio-flex-token-validator').functionValidator; | |
exports.handler = JWEValidator(async function(context, event, callback) { | |
// setup twilio client | |
const client = context.getTwilioClient(); | |
// parse data form the incoming http request | |
const channelSid = event.channelSid; |