This is an example of Sendbird Support Chat for React, implemented using Sendbird UIKit.
Sendbird Support Chat: Salesforce Connector is a Sendbird Chat integration into your existing Salesforce Service Cloud that offers support focused chat experience with vast new features for agent productivity. With this Support Chat Salesforce sample app, you can quick start your client-side implementation.
For sendbird developers: -> Internal docs: https://sendbird.atlassian.net/l/cp/Xm82koTf
node > 16.17.1
npm > 8
yarn can be used too
Assuming you alraedy have setup sendbird support chat in your salesforce org.
- Clone this repository.
- Install dependencies with
npm install. - Create a
.envfile in the root directory of the project. a. Use.env.exampleas a reference b. Fill in the values for the variables in.envfile. - Install the project with
npm install. - Run the project with
npm run dev.
For more information, see our documentation.
- Chat can be found inside
src/components/App.tsx - Chat is implemented using Sendbird UIKit
- Channel list header is overriden to show custom header
src/components/ChannelListHeader.tsx - Support chat channels are almost similar to group channels, except they have these custom types
{
customType: SALESFORCE_SUPPORT_CHAT_CHANNEL,
}
- Custom cover image is set for support chat channels using .env
VITE_CHANNEL_COVER_IMAGE
After the channel is initialized, we have to connect to Salesforce using the following API
fetch(`${SALESFORCE_API_URL}/services/apexrest/cases/`, {
method: 'POST',
body: JSON.stringify({
subject: title,
suppliedName: NICKNAME,
sendbirdUserId: USER_ID,
sendbirdChannelURL: channel.url,
isEinsteinBotCase: false,
}),
})
-
Note > Salesforce API URL can have CORS issues, so we recommend using a proxy server to make the API call or disabling cors through salesforce dashboard
-
Only after the above API is successful, Salesforce is notified about the new chat and the agent can start chatting with the customer.
- Leave channel
- Invite members
- Reactions, Threads, Replies, Voice Message, Mentions
- Message search
- Message delete
See
src/components/App.cssto see how we hide certain menus. Other features were disabled by passingdisable*props to the components.
(to do: Move to github actions)
- Delete remote gh-pages branch in remote and local
npm run build!important: Make sure you have thebaseinvite.config.tsset tosendbird-supportchat-sample-react(this is the name of the repo) before building the project.git checkout -b gh-pagesgit add dist -fgit commit -m "release: notes"git subtree push --prefix dist origin gh-pages
TLDR: Build the project and push the dist folder to gh-pages branch