-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update chat docs with new options and methods
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
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
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,30 @@ | ||
```typescript | ||
// This takes the same arguments as Plain.init. It will update the chat widget in-place with the new configuration. | ||
// Only top-level fields are updated, nested fields are not merged. | ||
Plain.update({ ... }); | ||
|
||
// This takes the same arguments as `customerDetails` in Plain.init. | ||
// This will update just the customer details in the chat widget. This may be useful if you have asynchronous authentication state | ||
Plain.setCustomerDetails({ ...}) | ||
|
||
// Opens and closes the widget if using the default, floating mode | ||
Plain.open(); | ||
Plain.close(); | ||
|
||
// These are event listeners that will be fired when the chat widget is opened or closed respectively | ||
// These return a function that can be called to remove the listener | ||
Plain.onOpen(() =>{ | ||
// Opened | ||
}); | ||
Plain.onClose(() => { | ||
// Closed | ||
}); | ||
|
||
// Returns whether or not the chat widget is initialized | ||
Plain.isInitialized(); | ||
|
||
// This returns an array with debug logs that have been collected by the chat widget | ||
// This is useful if you contacting Plain support with an issue regarding the chat widget | ||
// This will redact sensitive information such as customer details | ||
Plain.exportDebugLogs(); | ||
``` |
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