1.0.28 • Published 5 years ago

@corahq/sdk-web v1.0.28

Weekly downloads
8
License
BSD
Repository
github
Last release
5 years ago

Cora Widget (Web SDK)

npm version

Cora

Browsers support

BrowserSupport
IE < 11Not supported
IE 11Supported
EdgeSupported
Firefoxlast version - 1
Chromelast version - 1
SafariPartial Supported

Build project

$ npm run build

Publish to NPM

Increase a version in the package

$ npm publish --access=public

Start Local (without watch files)

$ npm run start

Start Development (with watch files)

$ npm run start:dev

Start Production

$ npm run start:prod

Start Server Linux

$ npm run server

To run on Windows with python, is necessary add task in script start or execute command below:

$ python http.server -m 8000

How to install Web SDK in your application

CDN

<link href="https://widget.corahq.com/zupcora-sdk.min.css" rel="stylesheet" />

<script src="https://widget.corahq.com/zupcora-sdk.min.js"></script>

NPM

$ npm i @corahq/sdk-web

Start WebSDK

Important, to execute Cora inside your application do you need configure your whitelist on Backoffice Cora.

<script>
const identifier = "reaba46y-ntssn4-11e9-jyf-5453rbaebllar"

const options = {
  refreshSession: true,
  customFields: {
    customerName: 'Jonas',
    securityToken: "kjraekreaJj43a4araetrj450"
  }
}

const events = {
  onStart: function() { console.log('Hello World')},
  onToggle: function() { console.log('Do something')}
}

zupcora.sdk.init(identifier, options, events)

</script>

SDK

ParamTypeDescriptionRequired
zupcoraobjectSDK objectyes
identifierstringUnique identifier from Cora project. Creating on channels, inside backoffice.yes
optionsobjectCustom optionsno
eventsobjectCallback eventsno

Controllers from SDK

  1. zupcora.sdk - Contains all public controllers from Cora SDK. Parameters:
ParamTypeDescriptionRequired
initfunctionStart SDKyes
togglefunctionControll open and close SDKno
  1. options - Options of the SDK. Parameters:
ParamTypeDescriptionRequired
refreshSessionbooltrue - create a new session on refresh page false - create a fingerprint sessionno - default false
customFieldsobjectcustom fields to take on runtime, support anything parametersno
  1. callback events - Callback support to dispatch actions on trigger event inside Cora
ParamTypeDescriptionRequired
onStartfunctionExecute function on start chat conversationno
onTogglefunctionExecute function on close and open chatno
onResizeDecreasefunctionExecute callback function on decrease chat windowno
onResizeIncreasefunctionExecute callback function on increase chat windowno
1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago