This is the single chatroom version of ChatV2 Widget App. Credits to Wenderson Pires.
A sample usage of the widget can be seen in this community page (please connect/subscribe to the page to view the hidden apps, including his chatroom widget ^_^): bbclan
-
Install all the dependencies:
yarn install
-
Run app locally:
- Start the app
yarn start:app
- Copy the code in
widget/ChatV2.dev.jsx
into NEAR BOS Sandbox to render the output- To change chat room, just edit room variable before rendering
-
Run viewer (not tested):
yarn start:vm
Now, you can see your changes in real time. Both in React App and Widget.
-
To build the app after local testing:
- Delete the following files
- .firebase - .firebaserc - firebase.json
- Create a production build of the app using
npm run build
- Setup Firebase Hosting for this app (requires GCP Firebase service account permission)
- Select dist folder as the public directory
- After deploy, open up the hosted link to check that it is working.
- Edit externalAppUrl variable in
widget/ChatV2.jsx
to the hosted link - Copy the code in
widget/ChatV2.jsx
into NEAR BOS Sandbox to render the output- To change chat room, just edit room variable before rendering
NEAR Social Bridge: A library that allows you to create a common application using ReactJS and inject it in a controlled way into a Widget on Near Social. Therefore, the Widget talks to the React application and vice versa, making it possible to consume Discovery API resources within the React application.
NEAR Social Local Viewer: A CLI tool that allows you to run and test your Near Social Widgets locally using just your preferred code editor and your default browser.