Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brainfish-ai/chat-widget

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brainfish-ai/chat-widget

This is a simple chat widget that can be embedded on any website. It is built using SolidJS and Socket.io.

  • 0.0.60
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
52
increased by1633.33%
Maintainers
1
Weekly downloads
 
Created
Source

Brainfish Chat Widget

This is a simple chat widget that can be embedded on any website. It is built using SolidJS and Socket.io.

Installation

npm install @branfish-ai/chat-widget

Directly in your HTML

<script type="module">
  import ChatWidget from 'https://cdn.jsdelivr.net/npm/@branfish-ai/chat-widget'

  ChatWidget.initStandard({
    chatAppId: 'YOUR_CHAT_APP_ID',
  })
</script>

<brainfish-standard-widget style="width: 100%; height: 600px; "></brainfish-standard-widget>

Popup

You can get the popup HTML and Javascript code by clicking on the "HTML & Javascript" button in the "Share" tab of your typebot.

Here is an example:

<script type="module">
  import ChatWidget from "https://cdn.jsdelivr.net/npm/@branfish-ai/chat-widget/dist/web.js";

  ChatWidget.initPopup({
    chatAppId: "YOUR_CHAT_APP_ID",
    autoShowDelay: 3000,
  });
</script>

This code will automatically trigger the popup window after 3 seconds.

Open or Close a popup

You can use these commands:

ChatWidget.open();
ChatWidget.close();
ChatWidget.toggle();

You can bind these commands on a button element, for example:

<button onclick="ChatWidget.open()">Contact us</button>

Bubble

You can get the bubble HTML and Javascript code by clicking on the "HTML & Javascript" button in the "Share" tab of your typebot.

Here is an example:

<script type="module">
  import ChatWidget from "https://cdn.jsdelivr.net/npm/@branfish-ai/chat-widget/dist/web.js";

  ChatWidget.initBubble({
    chatAppId: "YOUR_CHAT_APP_ID",
    previewMessage: {
      message: "Need help?",
      autoShowDelay: 5000,
      avatarUrl: "https://cdn-icons-png.flaticon.com/512/1587/1587565.png",
    },
    theme: {
      button: { backgroundColor: "#0042DA", iconColor: "#FFFFFF" },
      chatWindow: { backgroundColor: "#ffffff" },
    },
    settings: {
      languageSelector: {
        isEnabled: true,
      },
    },
  });
</script>

This code will show the bubble and let a preview message appear after 5 seconds.

Open or close the preview message

You can use these commands:

ChatWidget.showPreviewMessage();
ChatWidget.hidePreviewMessage();

This code will show the bubble and let a preview message appear after 5 seconds.

Open or close the typebot

You can use these commands:

ChatWidget.open();
ChatWidget.close();
ChatWidget.toggle();

You can bind these commands on a button element, for example:

<button onclick="ChatWidget.open()">Contact us</button>

FAQs

Package last updated on 02 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc