npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@arvato-crm/acai-chatwidget

v0.2.4

Published

ACAI Chat Widget for BotFramework-WebChat

Downloads

9

Readme

ACAI-ChatWidget

Built with love

An easy to use web widget for the Microsoft Bot Framework Web Chat

Usage

The ACAI-ChatWidget can be used in two ways:

  • in a pure HTML website (no webpack/npm or any other module system)
  • in a web application as npm package

HTML page

Currently there is no CDN to deliver the bundle. You can build a ACAI-ChatWidget release (see below) and use the js and css file from ./dist/ folder.

Place the files on your server and link to them:

<head>
    <script src="acai-chatwidget.js"></script>
    <link href="acai-chatwidget.css" rel="stylesheet" />
</head>
<body>
    ...
    <!-- DIV tag must be above initialization script -->
    <div id="BotChatGoesHere"></div>

    <script>
        var botChatDiv = document.getElementById('BotChatGoesHere');

        var config = {
            // use example config from section Configuration below
            ...
        }

        ACAI.ChatWidget(config, botChatDiv);
    </script>
    ...
</body>

Build release

  • Checkout from acai repository
  • Change into acai/acai-chatwidget
  • Run npm install to download all dependencies
  • Run npm run build:release to build a release
  • Release will be available at ./dist/

Example

You can find a complete example in ./demo/index.html. You only have to set directLineSecret and botId.
Run npm run build:watch to build a ACAI-ChatWidget release and open the HTML in your Browser.

npm package

You need to use our own Nexus server https://nexus.iaas-at-mit.de/ and one of the following repositories in your .npmrc

  • https://nexus.iaas-at-mit.de/content/groups/npm-all/ (preferred)
  • https://nexus.iaas-at-mit.de/content/groups/npm-internal/

.npmrc

...
registry=https://nexus.iaas-at-mit.de/content/groups/npm-all/
...

Install the ACAI-ChatWidget via npm install --save @arvato-crm/acai-chatwidget and use following code to include it in your JavaScript:

import * as ACAI from 'acai-chatwidget';
import 'acai-chatwidget/dist/acai-chatwidget.css';

var botChatDiv = document.getElementById('BotChatGoesHere');

var config = {
    // use example config from section Configuration below
    ...
}

ACAI.ChatWidget(config, botChatDiv);

Example

You can find a complete example in the acai git repository under acai/acai-chatwidget-npm-example. Open the readme.md to find information how the example works.

Configuration

The necessary configuration contains following entries:

var config = {
    botChat: {
        directLineSecret: '<secret>', // Direct Line Secret for Microsoft Bot Framework Web Chat
        botId: 'MyBot', // ID of this bot
        userId: '0815', // [optional] ID of user, if not set a random userId will be used
        userName: 'Customer', // [optional] name of user, it not set the userId will  be used
        initialMessage: '42' // [optional] initial message to trigger response from bot
    },
    ui: {
        bubbleDelay: 2000, // delay until bubble is shown
        bubbleTextDelay: 2500, // delay until text at bubble is shown
        bubbleText: 'Whazaaaap?!', // label in bubble text
        chatTitle: 'Your ad here' // label in sidebar chat title
    }
}

Styling

The easiest way to create a custom style for ACAI-ChatWidget is to use the acai-chatwidget.scss file from ./res/:

  • Copy the SASS file from this repo to your own project and call it acai-chatwidget-override.scss
  • Modify the file at your wishes
    • You can define font, colors and spaces easily with variables
    • Don't forget to create your own icons and set the icon files in the corresponding variables
  • Depending on your usage of ACAI-ChatWidget use one of the following ways to include the new style file to your page

HTML page

Compile the new sass file acai-chatwidget-override.scss to css with a tool of your choice and link to it in your HTML after acai-chatwidget.css:

<head>
    <script src="acai-chatwidget.js"></script>
    <link href="acai-chatwidget.css" rel="stylesheet" />
    <link href="acai-chatwidget-override.css" rel="stylesheet" />
</head>

npm package

Add sass-loader to your project if not present and configure webpack to load .scss files. Import the acai-chatwidget-override.scss after acai-chatwidget.css:

import * as ACAI from 'acai-chatwidget';
import 'acai-chatwidget/dist/acai-chatwidget.css';
import '<path>/acai-chatwidget-override.scss';

Development

Source code needed 😉

on-the-fly development

Useful to develop the default web design.

Run npm run build:watch to build the release in ./dist/ with regarding of changes in source files (js and scss, latter will be compiled to css). Open ./demo/index.html with any web browser. Reload page after changes are made (no auto reload yet).

npm scripts

| script | effect | | ------ | ------ | | npm run build | delete old release and build new dev release in ./dist/ | | npm run build:watch | delete old release and build new dev release in ./dist/, watches the filesystem for changes | | npm run build:release | delete old release and build new release in ./dist/, ready to publish | | npm run deploy | build release and publish to npmjs to org @arvato-crm, afterwards increment build number |

Library for Microsoft Bot Framework Web Chat

There are three ways to include Microsoft Bot Framework Web Chat into this npm package:

  • use Microsoft Bot Framework Web Chat npm package botframework-webchat
    • import via import * as BotChat from 'botframework-webchat/botchat.js; and import 'botframework-webchat/botchat.css'; in index.js
    • HINT: framework version should be set to a fixed value in package.json!
    • !!! THIS IS HOW IT IS CURRENTLY DONE !!!
  • use prebuilt library from github release page https://github.com/Microsoft/BotFramework-WebChat/releases and place it in ./lib/ folder
    • import via import * as BotChat from '../lib/botchat.js'; and import '../lib/botchat.css'; in index.js
  • clone repo from github https://github.com/Microsoft/BotFramework-WebChat.git, use instructions to build a botframework-webchat release (https://github.com/Microsoft/BotFramework-WebChat, chapter Building Web Chat) and place the release files in ./lib/ folder
    • import via import * as BotChat from '../lib/botchat.js'; and import '../lib/botchat.css'; in index.js

Folders and files

Dev files in ./src/

  • ACAI.js - code to provide ACAI-JS-module
  • ChatWidget.js - module to start BotChat
  • acai-chatwidget.ejs - html template to embedd in given DOM element

Ressource files in ./res/

  • bot.svg, bot-bubble.svg - icons for chat bubble and sidebar title
  • acai-chatwidget.scss - styling for chat bubble and style override for CSS of Microsoft Bot Framework Web Chat

Library files in ./lib/

  • botchat.js, botchat.css - code from Microsoft Bot Framework Web Chat, downloaded from github oder built from github code via npm

Release in ./dist/

  • release files (built with npm run build[:watch|:release])
    • to include in HTML (when used without wepback/npm)
    • to publish to NPM

Demo in ./demo/

  • index.html - open in browser, see chapter on-the-fly development