DEV Community

Cover image for Added a Chat-bot to Chrome Extension;
Areeb ur Rub
Areeb ur Rub

Posted on

3

Added a Chat-bot to Chrome Extension;

If you follow me then you might know I created one chrome extension which allows people to chat if they are using same website.

Know More:

Why a chatbot to extension

After Publishing my extension V1 I asked some of the users for review, and the said that they tried to use it on some websites but didn't got anyone to talk.

This is happening because of not having a huge number of users currently.

So to entertain my users I added a chatbot which can talk to them if no one is there.

How I did it.

Dialogflow
I used Dialogflow as a chat bot provider as it's natural speaking is amazing.

If you don't know about Dialogflow it is a Cloud Service Provided by Google, let you create chat bots and train them as you want them to talk

How it works in Chrome Extension,

Chrome extension don't work on frameworks like NodeJS or Flask so it was difficult to add Dialogflow library to it directly.

So what I did is, created a new flask(python) API as it's very simple to use Dialogflow's Python SDK and then hosted it on Heroku and used Dialogflow in my chrome extension via API calls.

I am not going in much details right now, if you want to know how I used Dialogflow in python and what codes I wrote then ask me in the comments.

To use API I used simple fetch() method and used the chat bot in an extension.

I tried so much to find a single way to do it without making my own API but I found no way to do it without a framework. I used Python as it fell easier to me but you can use any other framework (Ruby, PHP, NodeJS, etc...).

Try talking to the Bot:

Have a look to my Chrome Extension Click Here

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay