Socket
Book a DemoInstallSign in
Socket

@beyonk/svelte-facebook-customer-chat

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/svelte-facebook-customer-chat

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Beyonk

Svelte Facebook Customer Chat

js-standard-style CircleCI

Pure vanilla JS Facebook Customer Chat integration

facebook customer chat

Install

$ npm install --save-dev @beyonk/svelte-facebook-customer-chat

Usage (With Svelte)

<CustomerChat ref:fb page_id="163258547622199" theme_color="#05a092"  />

<script>
  import CustomerChat from '@beyonk/svelte-facebook-customer-chat'

	export default {
		components: {
			CustomerChat
		}
	}
</script>

The attributes you pass to the CustomerChat component are as per facebook documentation.

You definitely need to pass the attribute page_id.

Usage (Vanilla JS)

<div id="my-chat"></div>

<script>
  import CustomerChat from '@beyonk/svelte-facebook-customer-chat'

	const chat = new CustomerChat({
		target: document.querySelector('#my-chat'),
		data: {
			page_id: '1234567890',
			theme_color: '#ff0000'
		}
	})
</script>

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:

OptionDefaultRequiredDescription
localeen_GBfalseFacebook chat locale
versionv2.12falseFacebook Customer Chat SDK version
autoLogAppEventstruefalseas Facebook. Automatically log app events
libtruefalseUnique id to determine if component is loaded. You probably don't need to change this.

License

MIT License

Keywords

svelte

FAQs

Package last updated on 25 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts