Skip to main content
The Bigdata chat widget loads as a single script—no separate CSS file to host. You mount it on a container element and point it at a URL you control; your backend adds your Bigdata API credentials and forwards traffic to the Research Agent API. Chat widget in dark and light theme

How it fits together

Traffic makes one round trip through your backend: the widget only knows proxyUrl; your server holds the Bigdata credentials and relays the streaming response. Where each part runs — the chat UI and your proxy live on your side; the Research Agent runs in Bigdata’s infrastructure. What happens at each step — the browser posts JSON to your URL; your server adds the API key, calls Bigdata, and streams the response back.
Never put your Bigdata API key in frontend code or expose it in the browser. The widget is designed to call your proxy; the proxy must attach your API key when calling Bigdata.

Why you need a backend endpoint

End users can open developer tools and read any secret shipped to the page. The widget therefore sends chat requests to proxyUrl only. Your server (or serverless function) should:
  1. Authenticate the request if needed (cookie, session, or signed token).
  2. Add the Bigdata API key to the outbound request.
  3. Forward the JSON body to the Research Agent endpoint and stream the response back as Server-Sent Events (SSE).
The widget sends Content-Type: application/json on requests to proxyUrl. Your proxyUrl must be reachable from the visitor’s browser same-origin or with correct CORS (for example allowing POST and Content-Type when the page and API are on different origins). For request and response field details on the Bigdata side, see Research Agent API. A typical upstream URL is https://agents.bigdata.com/v1/research-agent (use the endpoint your onboarding materials specify).
If you use WordPress, contact support to ask about our Bigdata Widgets plugin instead of building the proxy yourself.

Browser compatibility

The script bundle targets modern evergreen browsers. It is not supported in Internet Explorer or other legacy engines without current Web APIs.
BrowserGuidance
ChromeRecent stable (desktop and Android).
EdgeRecent stable (Chromium-based).
FirefoxRecent stable.
Safari16.4 or newer on macOS and iOS. Earlier versions lack reliable support for constructible stylesheets and adoptedStyleSheets on the widget’s Shadow DOM, which the bundle uses to inject CSS.
Environment expectations
  • JavaScript enabled — the widget mounts via script and does not render without JS.
  • Streaming from your proxy — the client reads the proxy response as incremental text/event-stream data over XMLHttpRequest (POST with a JSON body). Middleboxes, strict proxies, or extensions that buffer or block streaming can delay or break live token display; align with Troubleshooting if replies appear only after completion.
  • Third‑party cookies — not required for the default embed pattern; auth is between the visitor’s browser and your proxyUrl (cookies or headers you set on that origin still apply).
For audiences on older locked-down browsers, contact support to discuss feasibility.

Quickstart

1

Add a sized container

Add a wrapper element and give it the size you want (fixed pixels, percentage, flex, grid, or min-height—whatever fits your page). The widget mounts inside it and stretches to fill the container’s box.
<div id="chat-widget" style="width: 100%; height: 560px;"></div>
2

Load the script

Use the widget script URL from Bigdata. Example shape (version path may differ). Load it before the inline script that constructs the widget so BigdataAgent is defined:
<script src="https://app.bigdata.com/widgets/chat/v1.0.0/bigdata-chat.min.js"></script>
3

Initialize the widget

Create the widget with new BigdataAgent.BigdataChatWidget({ ... }). At minimum set container and proxyUrl. Optional config, theme, and branding match the configuration reference below.
<script>
  new BigdataAgent.BigdataChatWidget({
    container: "#chat-widget",
    proxyUrl: "https://your-backend.com/api/chat-proxy",
    config: {
      suggestedQuestions: ["Nvidia most recent earnings analysis"],
    },
    theme: {
      preset: "light",
    },
  })
</script>

Global API: BigdataAgent

After the bundle loads, the UMD global BigdataAgent exposes BigdataChatWidget. Instantiate it with new BigdataAgent.BigdataChatWidget(config); the return value is the mounted widget instance.
Property / methodTypeDescription
BigdataAgent.BigdataChatWidgetclassConstructor: pass the same config object described in Configuration reference.
BigdataChat.versionstringOn window: build version string (diagnostics).
BigdataChat.buildTimestampstringOn window: build timestamp string (diagnostics).
Store the instance from new BigdataAgent.BigdataChatWidget(...) if you need to call destroy() or attach listeners.

Proxy contract (summary)

AspectExpected behavior
HTTP methodPOST to proxyUrl
Request Content-Typeapplication/json
Request bodyJSON including at least chat_id, message, research_effort, tools_configs, and from_interaction_id (the widget generates these fields; align your proxy with the Research Agent API).
ResponseContent-Type: text/event-stream with SSE data: frames the widget can parse
If streaming appears only after the full response completes, your stack may be buffering the response; the proxy and any reverse proxy must support streaming.

Configuration reference

Top-level options

OptionTypeDescription
containerstring or HTMLElementRequired. Where the widget mounts: a CSS selector that document.querySelector resolves, or a DOM element.
proxyUrlstringRequired. Your backend URL that forwards requests to the Research Agent.
instanceIdstringOptional. Stable id for this instance when several widgets share a page; if omitted, the implementation uses "chat".
managerBigdataWidgetManagerOptional. Shared manager across widgets for coordinated events and a common base theme.
configobjectOptional. Research and UX settings; see config (research and UX) below.
themeobjectOptional. Visual settings; see theme below.
brandingobjectOptional. Footer branding; see branding below.

config (research and UX)

FieldTypeDescription
researchEffort"lite" | "standard"Depth / execution mode for agent runs; defaults to "standard" if omitted.
suggestedQuestionsstring[]Optional starter prompts in the UI.
showAdvancedControlsbooleanShows advanced input controls when true.
inlineAttributionbooleanInline attribution behavior when supported.
placeholderstringInput placeholder (max 200 characters).
headerTitlestringHeader title (max 100 characters).
headerSubtitlestringHeader subtitle (max 200 characters).
categoryFilterobjectRestrict categories: { mode: "INCLUDE" | "EXCLUDE", values: string[] } (values are category identifiers your integration uses).

theme

The widget runs inside an open Shadow DOM, so host-page CSS does not change its internal layout or colors. Size the mount container in your page; the widget fills that container. You can also set theme.width and theme.height if you need explicit dimensions on the widget instead of relying on the container alone. Theme values are merged with defaults. preset chooses a base palette before overrides:
presetBehavior
lightLight background and text colors.
darkDark background and text colors.
autoFollows the user’s system preference (prefers-color-scheme).
FieldTypeDescription
primaryColorstringAccents (buttons, links).
backgroundColorstringWidget background.
surfaceColorstringCards / message surfaces.
textColorstringPrimary text.
textSecondaryColorstringMuted text.
borderColorstringBorders and dividers.
fontFamilystringFont stack; defaults to "inherit" (uses the host page’s font family).
fontSizestringBase size; defaults to "16px".
borderRadiusstringCorner radius (e.g. "8px").
widthstringOptional fixed width when not using a fully sized container.
heightstringOptional fixed height when not using a fully sized container.
preset"light" | "dark" | "auto"Base palette; see table above.

branding

FieldTypeDescription
showPoweredBybooleanWhether to show the “Powered by” footer; defaults to true. Set false to hide.
logoUrlstringOptional custom logo URL.

Multiple widgets and shared theming

Create one BigdataWidgetManager with an optional shared theme, pass it as manager in each new BigdataAgent.BigdataChatWidget({ ... }) config, and give each widget a distinct instanceId. That way instances stay isolated but can share base styling.

Instance lifecycle and events

  • destroy() — Unmounts React, clears the shadow root, and unregisters the instance. Call this when removing the widget from the page.
  • addListener(event, handler) / removeListener(event, handler) — Subscribe to widget events.
Event payloads include instanceName, timestamp, and data:
Eventdata shape (summary)
ready{ widgetName: string }
chatmessage{ prompt: string, researchEffort: "lite" | "standard" }
updatefilters{ categoryFilter?: { mode, values } }
opendocument{ documentId: string, isPrivate: boolean }
openlink{ url: string }
Advanced: to trigger a send from your own UI, you can emit("chatmessage", { prompt, researchEffort }) on the same instance the widget uses (same researchEffort values as in the table above).

Troubleshooting

Confirm the script URL loads (network tab, no 404). Ensure container matches an existing element. Check the browser console for validation errors (for example invalid proxyUrl).
Your proxyUrl origin must allow the site origin that embeds the widget (Access-Control-Allow-Origin and related headers for POST).
The proxy is rejecting the request before Bigdata. Verify server-side auth and that forwarded credentials match what your Bigdata integration expects.
Disable or reconfigure response buffering on your proxy, load balancer, or framework so text/event-stream is flushed incrementally.
For personalized help, use Support.