1.1.5 • Published 6 years ago
slaask-react v1.1.5
React Slaask
This package is a fork of react-slaask. This component adds the possibility to add extra information when sending a message. The extra information is defined as an object.
Installation
npm install slaask-react --saveNext , import the component into a React project:
import Slaask from 'slaask-react';Usage of the component
render() {
return (
<Slaask widgetKey="your-widget-key" name="name-of-person" extraOptions={object} showChatBox={bool} logChat={function} />
);
}| prop | description |
|---|---|
| widgetKey | The widgetKey you can obtain via slaask |
| name | Name of the person sending you a message |
| extraOptions | Extra options you want to include in the message. |
| showChatBox | Bool that hides or shows the button and chatbox |
| logChat | Execute a function when a first message is sent |
How to develop
Publishing the npm package constantly wouldn't be feasible. Luckily, you can use yarn link! This links this package to the project you wanna use it in!
Steps:
- Go to this project
yarn linkyarn start- Go to project you want to use the package in (for example LPF)
yarn link slaask-react- Succes!
Publishing
This could be done automatically, but for now only local publishing is possible:
- Bump version number in
package.json npm run-script buildnpm publish