ProfileConnectorHelper
Helper class for Profile Connector.
isSupportedTask(task) => boolean#
Check if a task is supported for profile connector - call, sms, whatsapp, or email are supported
Parameters:
- task: ITask- The active task in the Flex UI 
Returns:
- boolean- true if the task is supported for profile connector 
Example:
import { ProfileConnectorHelper } from "@twilio/flex-ui";const boolAnswer = ProfileConnectorHelper.isSupportedTask(task);isTaskValidForLinking(task) => boolean#
Check if a task has a valid Status for linking to a profile connector - assigned or wrapping are supported
Parameters:
- task: ITask- The active task in the Flex UI 
Returns:
- boolean- true if the task has a valid Status for linking to a profile connector 
Example:
import { ProfileConnectorHelper } from "@twilio/flex-ui";const boolAnswer = ProfileConnectorHelper.isTaskValidForLinking(task);getProfileConnectorForTask(task) => IProfileConnector#
Get profile connector for a task from redux store or local cache
Parameters:
- task: ITask- The active task to which the profile connector is associated 
Returns:
- IProfileConnector | undefined- profileConnector for the task 
Example:
import { ProfileConnectorHelper } from "@twilio/flex-ui";const profileConnector = ProfileConnectorHelper.getProfileConnectorForTask(task);setProfileConnectorForTask(task, profileConnector) => unknown#
Set profile connector for a task in redux store, local cache, and interaction context
Parameters:
- task: ITask- The active task to which the profile connector is associated 
- profileConnector: IProfileConnector- The profileConnector to set 
Example:
import { ProfileConnectorHelper } from "@twilio/flex-ui";ProfileConnectorHelper.setProfileConnectorForTask(task, profileConnector);eraseProfileConnectSidForTask(task) => unknown#
Erase profileConnectSid for a task - allow this to be undefined so TaskContext does not immediately re-fetch.
Parameters:
- task: ITask- the task to erase profileConnectSid for 
Example:
import { ProfileConnectorHelper } from "@twilio/flex-ui";ProfileConnectorHelper.eraseProfileConnectSidForTask(taskSid);