1.0.11 • Published 6 years ago

react-freshchat v1.0.11

Weekly downloads
3,659
License
ISC
Repository
github
Last release
6 years ago

React Freshchat

React Freshchat is a wrapper on top of Freshchat (see oficial doc here https://developers.freshchat.com/).

How to use

DO NOT INCLUDE Freshchat script in head, React Freshchat will automatically add it with lazy load technique

  • Install react-freshchat (see Installation).
  • Import the lib where you initialize your React App.
  • Include the component with the token.

Example

import React from 'react'
import FreshChat from 'react-freshchat'

class App extends React.Component {
  // ...
  render() {
    return <div>
      <FreshChat
        token={config.freshchat.token}
        email: 'user@email.com',
        first_name: '...',
        onInit={widget => {
          /* Use `widget` instead of `window.fcWidget`
            widget.user.setProperties({
              email: user.email,
              first_name: user.firstName,
              last_name: user.lastName,
              phone: user.phoneNumber,
            })
          */
        }}
      />
    </div>
  }
}

For more details: https://developers.freshchat.com/

Installation

Only NPM is supported for now: npm i -s react-freshchat

UMD Support

UMD is supported out of the box.

TODO

  • Unit Testing
  • Integrate Webpack
1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago