Javascript library to display denserbot on your website
pnpm install
pnpm dev
pnpm build
Add the following code to your HTML file:
<script type="module">
import Chatbot from 'https://cdn.jsdelivr.net/npm/@denserai/embed-chat@1/dist/web.min.js';
Chatbot.init({
chatbotId: '<chatbotId>',
initMessages: ['Hello', 'How can I help you?'],
});
</script>
Replace <chatbotId>
with your chatbot id.
-
chatbotId
: The chatbot id -
apiHost
: The API host (default:https://denser.ai
) -
theme
: theme object-
theme.darkMode
: The dark mode (default:false
) -
theme.button.size
: The button sizemedium
orlarge
(default:medium
) -
theme.button.backgroundColor
: The button color (default:white
) -
theme.button.color
: The button text color (default:black
) -
theme.button.bottom
: The button bottom position (default:20px
) -
theme.button.right
: The button right position (default:20px
) -
theme.chatWindow.backgroundColor
: The chat window background color (default:white
) -
theme.chatWindow.width
: The chat window width (default:undefined
) -
theme.chatWindow.height
: The chat window height (default:calc(100% - 100px)
)
-
-
initMessages
: The initial messages to display when the chatbot is opened (eg:['Hello', 'How can I help you?']
)
<script type="module">
import Chatbot from 'https://cdn.jsdelivr.net/npm/@denserai/embed-chat@1/dist/web.min.js';
Chatbot.init({
chatbotId: '<chatbotId>',
theme: {
button: {
size: 'large',
backgroundColor: 'black',
color: 'white',
bottom: '20px',
right: '20px',
},
chatWindow: {
backgroundColor: 'white',
width: '400px',
height: 'calc(100% - 100px)',
},
},
initMessages: ['Hello', 'How can I help you?'],
});
</script>
First, update the version:
npm version patch
Then, create a new tag and push it:
git tag v1.x.x
git push origin v1.x.x
Finally, create a new release on GitHub and the publish will be done automatically.
curl -X PURGE https://purge.jsdelivr.net/npm/@denserai/embed-chat@1/dist/web.min.js
Go to the following link and purge the file: