-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial Chat draft * Chat docs * Chat CSP * Fix lint
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
```typescript | ||
Plain.init({ | ||
appId: '<YOUR_CHAT_APP_ID>', | ||
|
||
// Hides the launcher, you can manually show it by calling `Plain.open()` (default: false) | ||
hideLauncher: false, | ||
|
||
// The title of the chat window shown on the Welcome screen | ||
title: 'Chat with us', | ||
|
||
// A collection of links shown on the Welcome screen | ||
links: [ | ||
{ | ||
text: 'View our docs', | ||
url: 'https://www.plain.com/docs', | ||
}, | ||
], | ||
|
||
// The color of your brand which will be used in parts of the Chat as well as the launcher color | ||
brandColor: '#000000', | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: 'Chat' | ||
sidebarTitle: 'Overview' | ||
--- | ||
|
||
_Chat is currently in Beta. This will not effect the reliability of this feature but we are heavily iterating and improving on the featureset._ | ||
|
||
Our Chat widget lets you embed a live chat interface on your website or app, allowing your customers to reach out to you without leaving your site. You can then respond to these messages directly from Plain. | ||
|
||
You and the customer can communicate in real-time and provide high fidelity support including syntax highlighting and rich-text formatting. | ||
|
||
Here’s how to get started: | ||
|
||
<Steps> | ||
<Step title="Create your Chat app"> | ||
*At the moment you can only create a single Chat app configuration per workspace. In future we | ||
will allow multiple configurations.* - In Plain, navigate to **`Settings`** > **`Chat`**. - | ||
Press **`Create Chat App`**. | ||
</Step> | ||
<Step title="Add Chat to your webpage(s)"> | ||
After creating your Chat app, you will be provided with a snippet of code that you can embed in | ||
your website or app. This will add the chat widget to your site. We recommend adding this to all | ||
pages of your site. | ||
</Step> | ||
<Step title="Customize your Chat experience"> | ||
You can customize some aspects of the Chat widget by providing additional information to the | ||
`Plain.init` function. These are the available options: | ||
<Snippet file="chat/customization.mdx" /> | ||
</Step> | ||
<Step title="Viewing Chats in Plain"> | ||
Each new conversation in the Chat widget creates a new thread in Plain. You can view and respond | ||
to these threads in the Plain app. | ||
</Step> | ||
</Steps> | ||
|
||
## Content Security Policy (CSP) | ||
|
||
If you are using a Content Security Policy on your website, you will need to add the following to your CSP: | ||
|
||
```text | ||
script-src https://cdn.plain.com; | ||
connect-src https://chat.uk.plain.com; | ||
style-src https://fonts.googleapis.com; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters