Detected country: US
logo
Open AppStatusSubmit Ticket
GuideAPI References
‌
‌
‌
logo

Powered by

  • Home
  • Distribution
  • Widgets & embedding

Widgets & embedding

1min read

Share

Brainfish web agents (Search bar, Sidebar, Popup) install as a small JavaScript module in your product or website. This section covers everything a developer needs to embed Brainfish, including framework guides, deployment patterns, custom triggers, and CSP/cache considerations.

How embedding works

A Brainfish web agent is a JavaScript module loaded from https://cdn.jsdelivr.net/npm/@brainfish-ai/web-widget@latest/dist/web.js. You initialize it with a widgetKey and the rest is handled in the browser:

<script type="module">
  import Brainfish from "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-widget@latest/dist/web.js";
  Brainfish.Widgets.init({ widgetKey: "bf_agent_YOUR_KEY" });
</script>

You can also install via npm (npm install @brainfish-ai/web-widget) for bundled apps, design systems, and micro-frontend shells.

Where the snippet goes

ArchitectureRecommended install point
Single-page app (React, Vue, Angular)App entry / root layout component
Micro-frontend / federated UIShell or shared design system layer
Server-rendered siteLayout template <head>
No-code / Tag ManagerInject via Google Tag Manager (with the no-import workaround)
Salesforce LightningLightning Web Component using loadScript

Whichever entry point you choose, install once at the highest shared layer so every page inherits the agent automatically.

Articles in this section

Reference embeds

  • Brainfish Search Bar & Pop-up Modal Guide
  • Implementing Brainfish Popup Agent With Custom Button
  • Brainfish Widget - Contextual Help
  • Brainfish Widget Overrides Guide

Framework guides

  • Integrating Brainfish Widgets with HTML
  • Integrating Brainfish Widgets with React
  • Integrating Brainfish Widgets with Vue
  • Integrating Brainfish Widgets with Angular
  • Integrating Brainfish Widgets with Salesforce Lightning Web Components (LWC)

Deployment patterns

  • Installing Brainfish in Micro-UI Architectures
  • How to Integrate Brainfish Widgets with Google Tag Manager: A Step-by-Step Guide

Content Security Policy (CSP)

If your site enforces CSP, allow these Brainfish domains:

frame-src   https://app.brainfi.sh https://agent.brainfi.sh
connect-src wss://analytic.brainfi.sh

See the framework guides for full examples.

Related sections

  • Agents — configure the agent before you embed it.
  • Help Center — the alternative to embedding: host on Brainfish.
  • Handoffs & Actions — wire up live chat, ticketing, or custom callbacks after answers.
Nested Articles

Brainfish Search Bar & Pop-up Modal Guide

Implementing Brainfish Popup Agent With Custom Button

Migration Guide: Upgrading to the New Brainfish Popup Widget

Integrating Brainfish Widgets with Solid.js

Integrating Brainfish Widgets with Vue

Integrating Brainfish Widgets with React

Integrating Brainfish Widgets with Salesforce Lightning Web Components (LWC)

How to Integrate Brainfish Widgets with Google Tag Manager: A Step-by-Step Guide

Installing Brainfish in Micro-UI Architectures

Integrating Brainfish Widgets with HTML

Integrating Brainfish Widgets with Angular

Brainfish Widget Overrides Guide

Brainfish Widget - Contextual Help

Attaching Images to Questions

Using the Widget History Tab

How to Set a Custom Mount Target for Your Pop-up Widget

Share