slaask-react

Slaask component for react with the possibility to add extra information in a message

Usage no npm install needed!

<script type="module">
  import slaaskReact from 'https://cdn.skypack.dev/slaask-react';
</script>

README

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 --save

Next , 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:

  1. Go to this project
  2. yarn link
  3. yarn start
  4. Go to project you want to use the package in (for example LPF)
  5. yarn link slaask-react
  6. Succes!

Publishing

This could be done automatically, but for now only local publishing is possible:

  1. Bump version number in package.json
  2. npm run-script build
  3. npm publish