Members
twilio-client:Device
# readonly voiceClient
Returns an instance of Twilio.Device which is used to handle calls.
twilio-taskrouter:Worker
# readonly workerClient
Returns an instance of Twilio TaskRouter Worker Client.
Methods
# static create(config, storeopt) → {Promise.<Manager>}
Creates an instance of Flex Manager
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
Configuration.AppConfiguration | Configuration | |
store |
ReduxStore.<FlexState> |
<optional> |
Custom Redux store |
New instance of manager
Promise.<Manager>
Example
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Manager, ContextProvider, RootContainer } from "@twilio/flex-ui";
Manager.create(configuration)
.then((manager) => {
ReactDOM.render(
<ContextProvider manager={manager}>
<RootContainer />
</ContextProvider>,
document.getElementById("container")
);
})
.catch((e) => {
console.log("Failed to run Flex", e);
});
# fetchConfiguration() → {Promise.<Configuration.AppConfiguration>}
Fetches Flex configuration from the service.
Promise.<Configuration.AppConfiguration>
# updateConfig(…configs)
Updates current configuration by merging provided configuration objects deeply with the current configuration.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
configs |
Configuration.AppConfiguration |
<repeatable> |
configuration objects to merge in |
Example
import { Manager } from "@twilio/flex-ui";
Manager.getInstance().updateConfig({
logLevel: "debug"
});
Type Definitions
Object
# UserInfo
User Info
Properties:
Name | Type | Description |
---|---|---|
identity |
string | identity |
roles |
Array.<string> | roles |
token |
string | access token |
tokenExpirationDate |
Date | token expiration date |