Comments (9)
Hello,
"npm start" is only a script to build the webchat component. It means that everytime you make a change in the /src folder, it will re-build a "webchat.js" in the /dist folder. You can see the change by opening index.html on your web browser.
But you can export the src/ folder in your project and rename it "webchat" and then import it using the code in the README.
from webchat.
The webchat could be on npm but I don't think anyone will publish it. A lot of features in this webchat is missing and it's also outdated.
from webchat.
Hello, the "website.js" is not a react component.
You have to use the index.js file in the src/ folder of the repo.
from webchat.
Hi Anton!
I don't fully understand. Does that mean that in order to use Recast AI as a react component I have to build my entire React app around this repo??
On the other hand I already tried running in the past the app to see if it does indeed work but when I run npm start it executes this script: "start": "npm run clean:dist && node bin/build-dev" (as defined in package.json), and it simply gets stuck in ' Waiting for changes... ', the app doesn't start on any port so I couldn't even test it.
Any ideas? I hope I was clear enough. Thanks for your support!!
from webchat.
Mystery solved, the trick is to open the src/index.html
directly in the browser!
I was looking for the serving port everywhere in the repo lol, I would highly recommend to add this in the README
installation instructions.
from webchat.
Hi TianyuanC!
Could you elaborate? I can see that if I clone the repo, enter mi channelID and token in the html script of the cai, then I run npm start and open index.html then yes, I can see the chatbot.
To be able to continue developing the app as a normal react app is where I fail.
Have you managed to achieve that?
from webchat.
Hi @turutupa
It would be ideal if we can export container/Chat
as npm package, so we can use it in other react projects.
But for me, I will probably need to customize the styles a lot to integrate into existing projects, so I will focus on src/actions
to understand the REST calls and then rebuild the UI...
Question for @antoncazalet , just curious, do we have plans to publish this awesome react control as public npm packages (also a control with the Fiori style would be perfect lol). Thanks!
from webchat.
What I was thinking is, the chat component is being rendered in Cai div (you can see it in script.js), I will probably create a new div in the html and render the rest of my react app there.
I think it is difficult for them to extract it as an npm package due to the dependencies it relies on, but perhaps could be done, idk
from webchat.
Ok so I manged to get it working but it not a very nice way.
I still haven't tested how to do it without having to manually open the html, will check that later. On the meantime I added this in script.js:
ReactDOM.render( <Provider store={store}> <Content /> </Provider>, document.getElementById('root'), )
Content is basically a component containing everything that is going to be render on the page. The element with id root is a new div with id root where everything is going to be rendered.
It is basically a fast way to get it working.
Perhaps this belongs to a different post but: is there a method when using CAI as React component to access the Bot Memory??? I see you can get the last message with the getLastMessage prop. Is there something similar??
Thanks in advance!
from webchat.
Related Issues (20)
- Parsing Incoming/Outgoing messages HOT 1
- ChatId fetching / message polling race condition
- How to create webchat iframe window? HOT 2
- The error message "Wrong memory format" is always shown. HOT 1
- Use multiple Webchats on one domain HOT 1
- Can we have an option to upload an image or a file in webchat HOT 1
- CSS rendering on IE 10-11
- Open WebChat on Buttonclick
- How to use with Fiori App
- Navigation with Routers within Fiori Web App
- Integrating WebChat into an Angular Web App HOT 5
- Displaying more than 3 buttons in response HOT 4
- Integrate O365 SSO
- import react component HOT 1
- On which port does the SAP CAI React project start upon running npm run start command? HOT 1
- Error: Request failed with status code 500 HOT 2
- Speech to text HOT 1
- Not able to install HOT 1
- Oauth integration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webchat.