Skip to content

Commit

Permalink
adding UNPKG instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
cozimacode committed Sep 12, 2020
1 parent 6cd7565 commit 1613395
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ npm install @cozimacode/react-bot
yarn add @cozimacode/react-bot
```

#### UNPKG

```html
<script src="https://unpkg.com/@cozimacode/react-bot"></script>
```

You can access it via window.ReactBot

## Usage

1- Import the ReactBot component in your app and pass the mandatory `handleUserInput` prop that accepts a function to process the user input.
Expand Down Expand Up @@ -61,7 +69,7 @@ import { ReactBot, addBotMessage } from '@cozimacode/react-bot';
function Demo() {
const handleUserInput = (input) => {
if (input.indexOf("Hi") > -1) {
addBotMessage("Hi there!)
addBotMessage("Hi there!")
}
};

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cozimacode/react-bot",
"version": "1.0.0",
"version": "1.0.1",
"description": "A clean, compact and responsive chat widget for React Apps.",
"author": {
"name": "Naser Mohd Baig",
Expand All @@ -17,7 +17,6 @@
"scripts": {
"build": "nwb build-react-component",
"clean": "nwb clean-module && nwb clean-demo",
"prepublishOnly": "npm run build",
"start": "nwb serve-react-demo"
},
"dependencies": {
Expand Down

0 comments on commit 1613395

Please sign in to comment.