https://github.com/beyonk-group/svelte-facebook-customer-chat
Facebook Messaging Platform - Customer Chat Integration
https://github.com/beyonk-group/svelte-facebook-customer-chat
beyonk customer-chat-plugin facebook facebook-messenger messenger messenger-platform svelte
Last synced: about 1 month ago
JSON representation
Facebook Messaging Platform - Customer Chat Integration
- Host: GitHub
- URL: https://github.com/beyonk-group/svelte-facebook-customer-chat
- Owner: beyonk-group
- License: mit
- Created: 2019-01-14T20:40:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-14T16:42:16.000Z (almost 4 years ago)
- Last Synced: 2025-08-30T03:06:44.986Z (about 2 months ago)
- Topics: beyonk, customer-chat-plugin, facebook, facebook-messenger, messenger, messenger-platform, svelte
- Language: HTML
- Size: 7.81 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Svelte Facebook Customer Chat
[](http://standardjs.com) [](https://circleci.com/gh/beyonk-adventures/svelte-facebook-customer-chat)
Pure vanilla JS Facebook Customer Chat integration

## Install
```bash
$ npm install --save-dev @beyonk/svelte-facebook-customer-chat
```## Usage (With Svelte)
```html
import CustomerChat from '@beyonk/svelte-facebook-customer-chat'
export default {
components: {
CustomerChat
}
}```
The attributes you pass to the CustomerChat component are [as per facebook documentation](https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin/).
You definitely need to pass the attribute `page_id`.
## Usage (Vanilla JS)
```html
import CustomerChat from '@beyonk/svelte-facebook-customer-chat'
const chat = new CustomerChat({
target: document.querySelector('#my-chat'),
data: {
page_id: '1234567890',
theme_color: '#ff0000'
}
})```
## Other (non facebook attributes)
There are a number of configuration attributes you can pass, but all are optional.
List of possible options in the module:
| Option | Default | Required | Description |
|-------------------|----------|----------|-----------------------------------------------------------------------------------------------------|
| locale | en_GB | false | Facebook chat locale |
| version | v2.12 | false | Facebook Customer Chat SDK version |
| autoLogAppEvents | true | false | as Facebook. Automatically log app events |
| lib | true | false | Unique id to determine if component is loaded. You probably don't need to change this. |## License
[MIT License](./LICENSE)