
This voice integration uses the NiCE CXone Agent for Service Cloud Voice (BYOT) Salesforce App to allow your agents to accept NiCE CXone calls in Salesforce Service Cloud Voice.
Agent Assist uses the voice call stream from NiCE CXone Agent Assist Hub to provide suggestions to your agents in the Salesforce Lightning Service Console.
Before you begin
To integrate Agent Assist UI modules with Salesforce, you need access to the following resources:
-
Follow the recommended installation instructions for your operating system.
-
Follow the recommended installation instructions for your operating system.
-
Install the
gcloudcommand as instructed and authenticate usinggcloud auth login. Salesforce UI
- Sign in at your instance URL or the Salesforce sign-in page and note the following:
- Your Salesforce My Domain URL. Follow these steps to find the My Domain URL:
- Navigate to the menu bar > Setup menu.
- Click Setup.
- In the Quick Find box, enter My Domain. The domain name is in the following format:
MY-DOMAIN-NAME.develop.my.salesforce.com.
- Your Salesforce organization ID. Follow these steps to find the organization ID:
- Navigate to the menu bar > Setup menu.
- Click Setup.
- In the Quick Find box, enter Company Information.
- Your Salesforce My Domain URL. Follow these steps to find the My Domain URL:
- Sign in at your instance URL or the Salesforce sign-in page and note the following:
Agent Assist integration backend
- Follow the instructions to set up the integration.
- Before running the deploy script, configure the following environment variables with
deploy.sh, or in an.envfile at the project root: AUTH_OPTION: Set this toSalesforceLWC.SALESFORCE_DOMAIN: A domain name similar toYOUR_SUBDOMAIN.develop.lightning.force.com. You noted this value in the Salesforce UI prerequisite. Note that you shouldn't includehttps://.SALESFORCE_ORGANIZATION_ID: You noted this value in the Salesforce UI prerequisite.
A NiCE CXone Agent Assist Hub add-on license
The NiCE CXone Agent Assist Hub add-on allows your NiCE CXone instance to send voice call media streams to Google Cloud's Agent Assist. NiCE CXone is a licensed product. More details are available in the NiCE CXone Agent Assist Hub documentation.
Step 1: Configure NiCE CXone Studio and NiCE CXone Agent Assist Hub
This step describes all the configuration necessary in your NiCE CXone instance.
Configure call flow with NiCE CXone Studio
In this step, you'll configure a programmatic call flow with NiCE CXone Studio to route incoming calls to your agents and send the call media streams to Agent Assist. Configure this call flow with the following NiCE CXone Studio triggers and actions, in this order:
- Sign in to NiCE CXone console.
- Open the Applications menu ().
- Open Omnichannel Routing > Studio.
- In the Studio page, create a New Script.
Configure this call flow with the following NiCE CXone Studio triggers and actions:
- Begin
- This trigger is activated when a call comes into your NiCE Point of Contact (POC) phone number.
- Reqagent
- This action sends the call to a specified skill. Select the skill associated with the agents who you would like to receive calls.
- Music
- This action plays hold music.
- Wait
- This action suspends the flow until another trigger is activated.
Separately, but in the same Studio flow, configure what happens when an agent picks up the incoming call.
- Onanswer
- This trigger is activated when an agent in the skill.
- Ziptone
- This plays a beep when an agent picks up the phone in a NiCE CXone agent desktop (such as the NiCE CXone Agent for Service Cloud Voice (BYOT) softphone).
- Agent Assist
- This action is responsible for creating a conversation and sending an incoming call's media streams to Dialogflow, so that the Agent Assist UI modules LWC can render the transcript and Agent Assist suggestions (such as PGKA, GKA, AI Coaching) in Salesforce. See this integration documentation for configuration details. Note: this step requires a pre-configured conversation profile.
You can also configure Agent Assist for outbound calls. The integration requires triggering the Agent Assist action when an outbound call is answered by the remote party. While the exact implementation depends on your configuration, this can typically be achieved in your script by using the Placecall action to initiate the call, and connecting the Agent Assist action to the OnAnswer branch of Placecall. See the NiCE CXone Studio help documentation for Placecall, Onanswer, and Agent Assist for more information.
Note NiCE CXone account details
Follow this step to collect your NiCE CXone account details. You will need this information to configure the NiCE CXone Agent for Service Cloud Voice (BYOT) in Salesforce later.
- Make a note of your NiCE Business Unit number from the NiCE CXone console. In your Salesforce project (which you will clone in an upcoming step), in
ServiceCloudVoicePlatformService.js, updateCONFIG.niceBusNoto reflect your NiCE Business Unit number. This will let your Agent Assist UI modules LWC determine the conversationName that NiCE CXone Agent Assist Hub creates (see thegenerateNiCEConversationNamemethod in the same file for details). - Make a note of your NiCE Point of Contact (POC) phone number from the NiCE CXone console. This is the number that your customers will call into to talk to your agents, and that you will use to test this Agent Assist integration.
Step 2: Set up your Salesforce development project
To start integrating Agent Assist UI modules, follow these steps.
- Run the following code to clone the Agent Assist integration repository and open your project:
git clone https://github.com/GoogleCloudPlatform/agent-assist-integrations cd salesforce/aa-lwc
- Run the following commands to download the UI modules JavaScript files which you deploy later as Static Resources. Salesforce requires the static resources to load third-party JavaScript.
npm run generate-static-resources npm install
- Update
ServiceCloudVoicePlatformService.jswith the NiCE Business Unit number you noted in a previous step:js const CONFIG = { // For this.platform = "servicecloudvoice-nice", the NiCE Business Unit Number // https://help.nicecxone.com/content/acd/businessunits/managebusinessunit.htm niceBusNo: 1234567 // Make sure this matches your NiCE CXone Business Unit Number. };
Step 3: Set up your Salesforce environment
You can integrate Agent Assist UI modules in a specific environment, such as production or development. Salesforce calls these environments organizations (orgs).
Configure your org with the Salesforce CLI
Follow these steps to use the Salesforce CLI to configure your org for Agent Assist integration.
- Run the following code and authenticate the CLI using the Salesforce login details you normally use.
npm run login
- Run the following code to deploy the LWC to the org.
npm run deploy
Step 4: Create an external client app
The Salesforce LWC uses the client credentials OAuth 2.0 flow to authenticate you. An external client app enables the client credentials flow. Use the app's consumer key and consumer secret to configure the Salesforce LWC to authenticate users with Salesforce.
- Navigate to the menu bar > Setup menu, then click Setup. In the Quick Find box, enter External Client App Manager.
- Click External Client App Manager > New External Client App > Create, then enter the following information.
- External Client App Name: lwc auth
- API Name: lwc_auth
- Contact Email:
your_email@example.com - API (Enable OAuth Settings) > Enable OAuth: Selected
- API (Enable OAuth Settings) > Callback URL: https://login.salesforce.com/services/oauth2/callback
- API (Enable OAuth Settings) > Selected OAuth Scopes: Access the identity URL service
- API (Enable OAuth Settings) > Enable Client Credentials Flow: Selected
- Click Create.
- Navigate to the menu bar > Setup menu, then click Setup. In the Quick Find box, enter External Client App Manager.
- Click your external client app's name > Edit.
- Navigate to OAuth Policies > OAuth Flows and External Client App Enhancements.
- Ensure Enable Client Credentials Flow is selected.
- For Run As, enter your login username.
- Click Save.
- Navigate to the menu bar > Setup menu, then click Setup. In the Quick Find box, enter External Client App Manager.
- Click your external client app's name > Edit.
- Navigate to OAuth Settings > App Settings > Consumer Key and Secret.
- Enter the verification code sent to your email.
- Copy the consumer key and consumer secret somewhere secure. You will need these for a later step.
Establish CORS and content security policies
- Navigate to the menu bar > Setup menu, then click Setup.
- In the Quick Find box, enter CORS, then click Edit.
- Select Enable CORS for OAuth endpoints.
- Click Save.
- Navigate to the menu bar > Setup menu, then click Setup.
- In the Quick Find box, enter Trusted URLs, then click New Trusted URL.
- Enter the following information:
- API Name: ui_connector
- URL: Enter the URL of the UI Connector Cloud Run Service endpoint you deployed with your Agent Assist Integration Backend. You can find this URL in the Cloud Run console. For example:
https://<var>UI_CONNECTOR_SUBDOMAIN</var>.<var>GCP_REGION</var>.run.app. - CSP Directives: Select all checkboxes. Click Save & New.
- Enter the following information:
- API Name: ui_connector_wss
- URL: Enter the URL of the UI connector Cloud Run Service endpoint you deployed with your Agent Assist Integration Backend. You can find this URL in the Cloud Run console. Change the protocol to wss, for WebSockets traffic. For example:
wss://<var>UI_CONNECTOR_SUBDOMAIN</var>.<var>GCP_REGION</var>.run.app. - CSP Directives: Select all checkboxes. Click Save & New.
- Enter the following information:
- API Name: salesforce_domain
- URL: Enter the URL of your Salesforce Domain with the following format:
https://<var>YOUR_SUBDOMAIN</var>.my.salesforce.com. - CSP Directives: Select all checkboxes. Click Save.
Step 5: Install NiCE CXone Agent for Service Cloud Voice (BYOT)
Salesforce provides the add-on license Service Cloud Voice, which allows integration of third-party softphones with your Salesforce instance. NiCE CXone provides a Service Cloud Voice add-on called NiCE CXone Agent for Service Cloud Voice (BYOT). Follow NiCE's documentation to set up NiCE CXone Agent for Service Cloud Voice (BYOT) in your SCV-enabled Salesforce instance.
Step 6: Install the Salesforce Lightning Web Component
Follow these steps to use the Lightning Experience Editor to add the Salesforce Lightning Web Component into the contact page where NiCE CXone Agent for Service Cloud Voice (BYOT) opens when a new call comes in.
- Navigate to the Service Console.
- Sign in to NiCE CXone Agent for Service Cloud Voice (BYOT) in the utility bar.
- Call the NiCE POC number associated with the NiCE account you signed in with.
- Accept the incoming call. This should result in a new Voice Call record tab being opened.
- Click the Setup menu > Edit Page.
- Click Template > Change.
- Select Header and Two Equal Regions.
- Click Next.
- Map each region to a new region.
- Click Done.
- From the Components sidebar, move the
agentAssistContainerModuleinto the sidebar. Note: Thenpm deploycommand provided this component. - Click the component you placed in the previous step and fill in the form fields as follows to add configuration details.
- endpoint: The URL of your integration backend's UI connector. For example, a URL from the Cloud Run console, like:
https://<var>UI_CONNECTOR_ENDPOINT</var>.<var>GCP_REGION</var>.run.app. - features: Agent Assist features to include. These must be enabled in your conversation profile. Some available features include
CONVERSATION_SUMMARIZATION,KNOWLEDGE_ASSIST_V2, andAGENT_COACHING. Note that some features, likeSMART_REPLY, are not available forvoice. - channel: Indicate that the integration is
voice. - platform: Indicate that the platform is
servicecloudvoice-nice. - conversationProfile: Your Agent Assist conversation profile resource name. For example,
projects/<var>GCP_PROJECT_ID</var>/locations/<var>GCP_REGION</var>/conversationProfiles/<var>CONVERSATION_PROFILE_ID</var>. - consumerKey: The external client app consumer key from step 4.
- consumerSecret: The external client app consumer secret from step 4.
- endpoint: The URL of your integration backend's UI connector. For example, a URL from the Cloud Run console, like:
Step 7: Test the integration
You can test the voice integration with a test call to the Salesforce call center.
- Sign in to NiCE CXone Agent for Service Cloud Voice (BYOT) from the Omni-Channel widget in the Service Console's utility bar.
- Call your NiCE CXone POC number. You can find this in the NiCE CXone console.
- In your Service Console, accept the incoming call. The screen should open a new Voice Call record.
- In the Voice Call record, the Salesforce Lightning Web Component should load in the sidebar.
- Test both sides of the conversation, ensuring that Agent Assist transcription and features are working as you've configured them in your conversation profile in the Agent Assist console.