Skip to content

Commit

Permalink
Chat docs (#108)
Browse files Browse the repository at this point in the history
* Initial Chat draft

* Chat docs

* Chat CSP

* Fix lint
  • Loading branch information
jordrake authored Oct 11, 2024
1 parent 3b6774c commit 58fee24
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
22 changes: 22 additions & 0 deletions _snippets/chat/customization.mdx
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',
});
```
44 changes: 44 additions & 0 deletions chat.mdx
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;
```
6 changes: 6 additions & 0 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
"slack/data-retention"
]
},
{
"group": "Chat",
"pages": [
"chat"
]
},
{
"group": "Microsoft Teams",
"pages": [
Expand Down

0 comments on commit 58fee24

Please sign in to comment.