Class

Manager

Manager

Flex Manager. Main entry point to control Flex instance.

Members

twilio-chat:Client

# readonly chatClient

Instance of Twilio Chat Client.
See:
Configuration.AppConfiguration

# readonly configuration

Current configuration
FlexEvent

# readonly events

Flex event emitter. User to subscribe to Flex events.
twilio-sync:Client

# readonly insightsClient

Returns an instance of Twilio Sync Client.
See:
Configuration.ServiceConfiguration

# readonly serviceConfiguration

Service configuration
ReduxStore.<FlexState>

# readonly store

Instance of Flex Redux store
See:
Strings

# strings

Get or set strings / templates for Flex. Add or updates existing ones.
Manager.UserInfo

# readonly user

Current user information
twilio-client:Device

# readonly voiceClient

Returns an instance of Twilio.Device which is used to handle calls.
See:
twilio-taskrouter:Worker

# readonly workerClient

Returns an instance of Twilio TaskRouter Worker Client.
See:
twilio-taskrouter:Workspace

# readonly workspaceClient

Returns an instance of Twilio TaskRouter Workspace Client.
See:

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
FlexError
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);
 });

# static getInstance() → {Manager}

Gets the instance of Manager
instance
Manager

# fetchConfiguration() → {Promise.<Configuration.AppConfiguration>}

Fetches Flex configuration from the service.

# 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
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Protected by reCAPTCHA – PrivacyTerms