React / Next.js / Static

Universal Embed for Custom Web Applications

Frosty Agent embeds on any modern web application using a vanilla JavaScript IIFE script or a React/Next.js client layout component. The widget communicates with Frosty backend APIs over streaming Server-Sent Events (SSE) without requiring external UI dependencies.

Verified Connector Production Ready Instant Activation

What Connects and How Data Moves

Bi-directional, encrypted data pipelines between Custom HTML & Modern Frameworks and your Frosty Agent workspace.

INInbound to Frosty Agent
Capture Stream

Data captured or received from Custom HTML & Modern Frameworks during active customer sessions:

  • Visitor messages and browser context
  • Optional client metadata and attribution
  • Recorded visitor voice notes (transcribed, answered in text)
OUTOutbound from Frosty Agent
Action Dispatch

Deterministic actions, responses, and events dispatched to Custom HTML & Modern Frameworks:

  • Server-Sent Event text tokens
  • Dynamic structured action cards

Step-by-Step Setup for Custom HTML & Modern Frameworks

Follow these exact instructions to configure and activate the integration in your production environment.

1

Choose HTML Script or React Component

Use the standard HTML script snippet for static/server templates, or mount the FrostyWidget client component in your React/Next.js root layout.

Code Snippet
// Next.js App Router (app/layout.tsx)
'use client';
import { useEffect } from 'react';

export function FrostyWidget() {
  useEffect(() => {
    if (document.querySelector('script[data-frosty-key="YOUR_KEY"]')) return;
    const s = document.createElement('script');
    s.src = 'https://widget.frostyagent.com/frosty-widget.js';
    s.async = true;
    s.dataset.frostyKey = 'YOUR_PUBLISHABLE_KEY';
    s.dataset.frostyPosition = 'bottom-right';
    document.body.appendChild(s);
  }, []);
  return null;
}
2

Configure Allowed Domains in Dashboard

In Merchant Dashboard Settings, verify your production domain to ensure authorized widget access.

3

Verify Streaming Responses

Test message exchanges in your staging environment to verify streaming SSE responses, including a recorded voice note.

Capabilities Unlocked

Full Autonomous Actions

Conversational capabilities active immediately upon setup:

  • Full compatibility with modern Single Page Applications (SPAs) and Server-Side Rendered (SSR) frameworks.
  • Real-time streaming text responses with sub-second time-to-first-token.
  • Voice notes recorded in the widget are transcribed and answered in text (spoken replies and live voice are not offered).
  • Granular client session persistence across browser reloads via local session tokens.

Operational Boundaries

Guardrails & Limits

Boundaries and security rules governing this connection:

  • The widget communicates from an isolated sandbox origin to ensure host page security.
Platform FAQ

Questions About Custom HTML & Modern Frameworks Integration

JavaScript AI Chatbot Embed for React, Next.js & HTML | Frosty Agent