8000 GitHub - adammanter/react-messenger-customer-chat: React component for messenger customer chat plugin
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

adammanter/react-messenger-customer-chat

 
 

Repository files navigation

React Messenger Customer Chat

React component for messenger customer chat plugin

npm Build Status License: MIT

Screenshot

Prerequisite

Whitelist your domain to connect your Facebook Page to your website via the Facebook tool.

  • From UI: Facebook Page Settings > Messenger Platform > Whitelisted Domains
  • From API: Use HTTP API or API client likes messaging-api-messenger

Installation

npm install react-messenger-customer-chat

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import MessengerCustomerChat from 'react-messenger-customer-chat';

ReactDOM.render(
  <MessengerCustomerChat
    pageId="<PAGE_ID>"
    appId="<APP_ID>"
    htmlRef="<REF_STRING>"
  />,
  document.getElementById('demo')
);

Note: It will handle sdk initialize automatically for you. See more details in fbsdk official docs.

Props

static propTypes = {
  pageId: PropTypes.string.isRequired,
  appId: PropTypes.string.isRequired,

  htmlRef: PropTypes.string,
  minimized: PropTypes.bool,
  autoLogAppEvents: PropTypes.bool,
  xfbml: PropTypes.bool,
  version: PropTypes.string,
  language: PropTypes.string,
  debug: PropTypes.bool,
};

static defaultProps = {
  htmlRef: undefined,
  minimized: undefined,
  autoLogAppEvents: true,
  xfbml: true,
  version: '2.11',
  language: 'en_US',
  debug: false,
};

License

MIT © Yoctol

About

React component for messenger customer chat plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 84.2%
  • HTML 12.4%
  • CSS 3.4%
0