0.4.6 • Published 1 year ago

@livechat/chat-widget v0.4.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Chat Widget

Installation

npm install --save @livechat/chat-widget

Preview

In order to embed chat widget's preview in your application, you can import preview function from special entry point (@livechat/chat-widget/preview) and call it with target element, like this:

import preview from '@livechat/chat-widget/preview'

const store = preview({
  target: document.getElementById('chat-widget-preview'),
})

In return you will get a special store object on which you will be able to call methods in order to manipulate store's data, current shown view, etc. It is a @livechat/chat-store's instance - for full API you can look into its documentation.

Besides target you can also pass in state and props.

  • state - will be passed in to the @livechat/chat-store as initialState
  • props - will be passed to the root Application component
    • onAnimationEnd - gets called when animation ends
    • onClick - gets called whenever user clicks on minimize button (to maximize) or a minimized widget (to minimize). You can return a promise from your onClick to delay actual state change until your promise resolves (useful if you need to i.e. resize containing element before changing state).

Enable feature

Available features:

  • agentAvatar
  • emailTranscript
  • facebookButton
  • googlePlusButton
  • rating
  • twitterButton
store.updateFeature('rating', { enabled: false })
store.updateFeature('facebookButton', {
  enabled: true,
  path: 'https://www.facebook.com/livechatpany',
})

Show mobile view

store.setApplicationState({ mobile: true })

Updating minimized type

store.updateConfig({
  minimizedType: 'bar', // or 'circle'
})

set RTL language type

store.setApplicationState({ rtl: true })

Updating theme

store.updateTheme({
  name: 'smooth', // name: 'modern'
  agentMessageColorBackground: '#fffff',
  agentMessageColorText: '#424d57',
  backgroundColor: '#e9eef4',
  minimizedColorBackground: '#ffffff',
  minimizedColorIcon: '#4384F5',
  minimizedColorText: '#000000',
  visitorMessageColorText: '#ffffff',
  visitorMessageColorBackground: '#4384f5',
  titlebarBackgroundColor: '#ffffff',
  titlebarText: '#424d57',
  systemMessageColor: '#424d57',
  agentbarBackgroundColor: '#fff',
  agentbarText: '#424d57',
  customJson: '',
})
0.4.5

1 year ago

0.4.6

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.29

2 years ago

0.3.28

2 years ago

0.3.27

2 years ago

0.3.26

3 years ago

0.3.25

3 years ago

0.3.24

3 years ago

0.3.23

3 years ago

0.3.22

3 years ago

0.3.21

3 years ago

0.3.19

3 years ago

0.3.18

4 years ago

0.3.17

4 years ago

0.3.16

4 years ago

0.3.15

4 years ago

0.3.14

4 years ago

0.3.13

4 years ago

0.3.12

4 years ago

0.3.11

4 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0-32

6 years ago

0.1.0-31

6 years ago

0.1.0-30

6 years ago

0.1.0-29

6 years ago

0.1.0-28

6 years ago

0.1.0-27

6 years ago

0.1.0-26

6 years ago

0.1.0-25

6 years ago

0.1.0-24

6 years ago

0.1.0-23

6 years ago

0.1.0-22

6 years ago

0.1.0-21

6 years ago

0.1.0-20

6 years ago

0.1.0-19

6 years ago

0.1.0-18

6 years ago

0.1.0-17

6 years ago

0.1.0-16

6 years ago

0.1.0-15

6 years ago

0.1.0-14

6 years ago

0.1.0-13

6 years ago

0.1.0-12

6 years ago

0.1.0-11

6 years ago

0.1.0-10

6 years ago

0.1.0-9

6 years ago

0.1.0-8

6 years ago

0.1.0-7

6 years ago

0.1.0-6

6 years ago

0.1.0-5

6 years ago

0.1.0-4

6 years ago

0.1.0-3

6 years ago

0.1.0-1

6 years ago

0.1.0-0

6 years ago