Manager
The Flex Manager is the access point for controlling your Flex instance and all of the underlying Twilio products used for communications and assigning tasks. This means that within your Flex project, you can access the TaskRouter or Chat client directly through the Flex manager. Aside from Flex itself, Manager also gives you access to the Conversations, Sync, Voice, and TaskRouter SDKs.
create(config, store?) => Promise<Manager>#
Creates an instance of Flex Manager
Parameters:
Returns:
Promise<Manager>
New instance of 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); });
updateConfig(configs) => void#
Updates current configuration by merging provided configuration objects deeply with the current configuration.
Parameters:
configs: Config
configuration objects to merge in
Returns:
void
Example:
import { Manager } from "@twilio/flex-ui";Manager.getInstance().updateConfig({ logLevel: "debug"});
fetchConfiguration() => Promise<Config>#
Fetches Flex configuration from the service.
Returns:
Promise<Config>
Flex configuration
Example:
import { Manager } from "@twilio/flex-ui";const config = await Manager.getInstance().fetchConfiguration();
Example:
import { Manager } from "@twilio/flex-ui";Manager.getInstance().configuration;
serviceConfiguration: ServiceConfiguration#
Service configuration
Example:
import { Manager } from "@twilio/flex-ui";const accountSid = Manager.getInstance().serviceConfiguration.account_sid;
store: EnhancedStore<FlexState>#
Instance of Flex Redux store.
Example:
import { Manager } from "@twilio/flex-ui";Manager.getInstance().store
events: FlexEventEmitter#
Flex event emitter. Use to subscribe to Flex events.
events: FlexEventEmitter#
Flex event emitter. Use to subscribe to Flex events.
Example:
import { Manager } from "@twilio/flex-ui";Manager.events.removeAllListeners();
user: UserInfo#
Current user information
conversationsClient#
Instance of Twilio Conversation Client.
voiceClient: twilio-client:Device#
Returns an instance of Twilio.Device
which is used to handle calls.
workerClient: twilio-taskrouter:Worker#
Returns an instance of Twilio TaskRouter Worker Client.
workspaceClient: twilio-taskrouter:Workspace#
Returns an instance of Twilio TaskRouter Workspace Client.
insightsClient: twilio-sync:Client#
Returns an instance of Twilio Sync Client.