Skip to content
Widget SDK

Type Reference

TypeScript interfaces for ChatboxConfig, BubbleConfig, IdentifyPayload, and instances.

Type Reference#

TypeScript
interface ChatboxConfig {
  apiKey: string;
  container?: HTMLElement;
}

interface BubbleConfig {
  apiKey: string;
  position?: 'bottom-right' | 'bottom-left';
  bubbleColor?: string;
  bubbleSize?: number;
  bubbleIcon?: string;
  bubbleIconSize?: number;
  offset?: {
    bottom?: number;
    right?: number;
    left?: number;
  };
}

interface IdentifyPayload {
  visitorId: string;
  name?: string;
  email?: string;
  phone?: string;
  company?: string;
  latitude?: number;
  longitude?: number;
  /** Shopify Customer Account API bearer token. SENSITIVE — forwarded to the
   *  chat agent per-turn via a post-handshake postMessage; never logged or
   *  included in the iframe URL. */
  shopifyCustomerToken?: string;
  /** Shopify cart GID for the buyer's active cart
   *  (e.g. "gid://shopify/Cart/abc123"). */
  shopifyCartId?: string;
}

interface ChatboxInstance {
  destroy(): void;
}

interface BubbleInstance {
  open(): void;
  close(): void;
  toggle(): void;
  destroy(): void;
  readonly isOpen: boolean;
}

We use cookies to run and improve Gydr.

Read our Cookie Policy