import { type MountOptions } from './index.js'; interface BaseProps { /** Relay URL — set as NEXT_PUBLIC_RELAY_URL in .env. Any scheme works: * `https://api.example.com` is fine. The WebSocket URL and REST base are * derived automatically — you do NOT need to pass `wss://` or `/ws`. */ url: string; /** HTTP(S) base for REST calls — only when the REST API is on a different * origin than the socket. Normally omit. */ apiUrl?: string; /** Your Relay profile ID — set as NEXT_PUBLIC_RELAY_PROFILE_ID in .env — required */ profileId: string; /** A signed identity token — an ES256 JWT `{sub,iat,exp}` minted by YOUR * backend for chatrooms with signed identity (guestPublicKey) enabled. * This is the production identity tier; wins over `userId`. */ token?: string; /** Called when a signed token expires: return a fresh token from your * backend to renew the session without a reload. */ refreshToken?: () => Promise; /** Your logged-in user's stable ID. When omitted the widget automatically * assigns a persistent anonymous ID from localStorage — no login required. */ userId?: string; /** Shown to agents instead of the raw user ID */ userName?: string; /** Shown to agents so they can follow up by email */ userEmail?: string; /** Avatar URL shown in the widget header and dashboard */ userAvatar?: string; /** Brand colour hex, e.g. "#1a56db". Defaults to the profile theme colour. */ accent?: string; /** Secondary accent (guest bubble + send button); follows `accent` when omitted. */ accent2?: string; /** Colour scheme: 'auto'|'light'|'dark'. */ theme?: 'auto' | 'light' | 'dark'; /** Load Baloo 2 + Nunito webfonts (default true). */ webfont?: boolean; /** Render as a floating launcher button instead of inline */ launcher?: boolean; /** Launcher position — default 'bottom-right' */ position?: 'bottom-right' | 'bottom-left'; /** Launcher teaser ("optional message" above the bubble). String or * { title, subtitle }. Omit to use the chatroom's manifest value. */ launcherMessage?: string | { title: string; subtitle?: string; }; /** Pre-set reply chips shown above the input */ quickReplies?: string[]; /** Container height when rendered inline. Default: '100%' */ height?: string; /** UI language ('ko', 'ko-KR', …). Omit to auto-detect from the browser. */ locale?: MountOptions['locale']; /** i18n string overrides for non-English sites */ i18n?: MountOptions['i18n']; /** Per-tenant feature switches (default all ON). Set a flag false to disable * reactions, CSAT, or KB deflection. */ features?: MountOptions['features']; /** ISO language code for auto-translating incoming messages */ translateLang?: string; /** Show a back chevron in the chatroom header that opens the full conversation * list (`ChatApp`) — turns a single-thread widget into a Channel.io-style app * where you can jump to any of the user's other conversations and back. */ inbox?: boolean; /** Inbox scope when `inbox` is set: 'tenant' (default) lists the user's threads * across ALL your chatrooms; 'profile' limits it to this one. */ inboxScope?: 'tenant' | 'profile'; } export interface ChatWidgetProps extends BaseProps { /** Optional context card shown at the top of the chat * (e.g. the support ticket, booking, or order being discussed) */ contextTitle?: string; contextSubtitle?: string; contextStatus?: string; /** Stable item ID — pins this conversation to a specific item/thread. */ subjectId?: string; } /** * General-purpose support chat widget. Only `url` and `profileId` are required. * All other props are optional — anonymous guests work without any configuration. * * @example Basic support chat * ```tsx * * ``` * * @example Multi-thread (tickets, bookings, orders) — one thread per subjectId * ```tsx * * ``` * * Need a list of the user's threads with tap-to-open? That's `` * (inline) or `` (floating bubble) — this component renders * a single conversation. */ export declare function ChatWidget({ url, apiUrl, profileId, token, refreshToken, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, accent2, theme, webfont, launcher, position, launcherMessage, quickReplies, height, i18n, features, translateLang, inbox, inboxScope, locale, }: ChatWidgetProps): JSX.Element; export interface MarketplaceChatProps extends BaseProps { /** Unique ID for this listing — each listing gets its own thread. * Omit for a general (non-item-specific) conversation. */ listingId?: string; /** Shown at the top of the chat — e.g. "2019 Toyota Camry SE" */ listingTitle?: string; /** One-line detail — e.g. "45,000 km · Automatic" */ listingMeta?: string; /** Price shown as a tag — e.g. 12500 → "$12,500" */ listingPrice?: number; /** Status badge — e.g. "Available", "Sold", "Pending" */ listingStatus?: string; } /** * Marketplace chat widget. Two modes depending on whether `listingId` is provided: * * **With `listingId` (listing page)** — opens that listing's chat immediately. * No list screen. The buyer is already looking at the item so context is clear. * ```tsx * // On your listing detail page: * * ``` * * **Without `listingId`** — opens the buyer's single general (non-listing) * thread with this chatroom. For a "My Messages" / inbox page with the * WhatsApp-style thread list and tap-to-open, use `` (or * `` for a floating bubble): * ```tsx * // On your /messages page: * * ``` * * Only `url` and `profileId` are required. All other props are optional. */ export declare function MarketplaceChat({ url, apiUrl, profileId, token, refreshToken, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, accent2, theme, webfont, launcher, position, launcherMessage, quickReplies, height, i18n, features, translateLang, inbox, inboxScope, locale, }: MarketplaceChatProps): JSX.Element; export interface ChatAppProps { /** Relay URL — ONE url, any scheme; `https://api.relay.paramms.com` is the * recommended form. The WebSocket URL and REST base are derived from it — * you do NOT need to pass `wss://` or `/ws`. */ url: string; /** HTTP(S) base for REST calls — only when the REST API is on a different * origin than the socket. Normally omit. * @deprecated pass a single `url`; kept for back-compat. */ apiUrl?: string; /** A chatroom id. Provide `profileId` OR `tenantId` (see below). When both * are given, profileId also fixes where the ✎ "new conversation" opens. */ profileId?: string; /** Tenant-level identification — the natural fit for a chat app: lists * EVERY conversation this user has with your business across ALL of its * chatrooms, without naming one. Use this when the platform runs several * chatrooms under one tenant (e.g. a marketplace chatroom for * `` pages PLUS a general-support chatroom) — the inbox * shows both, and each row opens against its own chatroom. The ✎ compose * button opens the tenant's default chatroom (its oldest, as reported by * the server). */ tenantId?: string; /** A signed identity token (ES256 JWT) for chatrooms with signed identity * enabled — the production tier. Wins over `userId`. */ token?: string; /** Return a fresh token when a signed token expires. */ refreshToken?: () => Promise; /** Your logged-in user's stable ID. Omit for anonymous (uses localStorage UID) */ userId?: string; /** Optional: shown to agents in the dashboard */ userName?: string; /** Optional: shown to agents in the dashboard */ userEmail?: string; /** Which conversations the list shows when configured with a profileId * (default 'tenant'; irrelevant with `tenantId`, which is always * tenant-wide): * 'tenant' — every conversation this user has with the business that * owns `profileId`, across ALL of its chatrooms — like a real * messaging app. Each row opens against its own chatroom. * 'profile' — only this chatroom's threads (the pre-1.0.30 behaviour). * Tenancy note: guests never see or send tenant ids — the server resolves * the tenant FROM the profileId, so `profileId` stays the only id you * configure. */ scope?: 'profile' | 'tenant'; /** Brand colour hex — default '#6c5ce7' */ accent?: string; theme?: 'auto' | 'light' | 'dark'; webfont?: boolean; /** Container height. Default: '100%' */ height?: string; /** When provided, ChatApp renders an always-visible close (✕) control in the * top-right corner of its container. Pass this whenever ChatApp is shown in * an overlay/panel or as a mobile-fullscreen surface (ChatAppLauncher wires * it automatically) so there is a reliable way OUT — without it, an inline * fullscreen panel on a phone (no Escape key, no reachable backdrop) traps * the user. Omit for a bare inline embed the host chromes itself. */ onClose?: () => void; /** UI language ('ko', 'ko-KR', …). Omit to auto-detect from the browser. */ locale?: string; /** i18n overrides */ i18n?: import('./chatlist.js').ChatListOptions['i18n']; } /** * Full chat-app component: conversation list on the left (or full screen on * mobile), chat room on the right when a thread is selected — like a * standalone messaging app. Tapping a thread opens the chat inline; the ✎ * button starts a new conversation with the business. * * By default (`scope="tenant"`) the list shows EVERY conversation this user * has with the business that owns `profileId` — across all of its chatrooms — * and each row opens against its own chatroom. Pass `scope="profile"` to * limit it to one chatroom's threads. * * Identify at either level: * • `tenantId` — the natural fit for a chat app. A platform often runs * SEVERAL chatrooms under one business (a marketplace chatroom for * `` pages plus a general-support chatroom, …); with * `tenantId` the inbox shows the user's chats with all of them, no * profileId needed. Compose opens the tenant's default chatroom. * • `profileId` — any one of the business's chatrooms; still lists * tenant-wide by default (`scope="tenant"`), and fixes where compose * opens. * * @example * ```tsx * 'use client' * import { ChatApp } from '@paramms/chat-widget/react' * * export default function MessagesPage({ session }) { * return ( *
* *
* ) * } * ``` */ export declare function ChatApp({ url, apiUrl, profileId, tenantId, token, refreshToken, userId, userName, userEmail, accent, theme, webfont, height, i18n, onClose, locale, scope, }: ChatAppProps): JSX.Element; export interface ChatAppLauncherProps { /** Relay URL — ONE url, any scheme; `https://api.relay.paramms.com` is the * recommended form. The WebSocket URL and REST base are derived from it. */ url: string; /** HTTP(S) base for REST calls — only when REST is on a different origin. * @deprecated pass a single `url`; kept for back-compat. */ apiUrl?: string; /** A chatroom id. Provide `profileId` OR `tenantId`. */ profileId?: string; /** Tenant-level identification — the panel lists EVERY conversation this * user has with your business across ALL of its chatrooms (see * ChatAppProps.tenantId). The ✎ compose opens the tenant's default * chatroom. */ tenantId?: string; /** A signed identity token (ES256 JWT) for chatrooms with signed identity * enabled — the production tier. Wins over `userId`. */ token?: string; /** Return a fresh token when a signed token expires. */ refreshToken?: () => Promise; /** Your logged-in user's stable ID */ userId?: string; userName?: string; userEmail?: string; /** Which conversations the panel's list shows — see ChatAppProps.scope. * Default 'tenant': every conversation this user has with the business. */ scope?: 'profile' | 'tenant'; /** Brand colour hex — default '#6c5ce7' */ accent?: string; /** true → floating bubble fixed to the corner of the screen (like Intercom) * false → an inline "Messages" button that expands a panel below it * Default: true */ floating?: boolean; /** Only used when floating=true. Default: 'bottom-right' */ position?: 'bottom-right' | 'bottom-left'; /** Label shown on the button. Default: a chat-bubble icon for floating, * 'Messages' for inline. */ label?: string; /** Width of the chat panel. Default: '420px' (floating) or '100%' (inline) */ panelWidth?: string; /** Height of the chat panel. Default: '600px' */ panelHeight?: string; } /** * A button that opens the full ChatApp (list → chat) in a panel. * * floating=true → fixed bubble in the corner of the screen, like WhatsApp Web's * chat button or Intercom. * floating=false → an inline button (e.g. in your nav bar) that expands a panel * below it. * * @example Floating bubble (bottom-right) * ```tsx * * ``` * * @example Inline nav button * ```tsx * * ``` */ export declare function ChatAppLauncher({ url, apiUrl, profileId, tenantId, token, refreshToken, userId, userName, userEmail, scope, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element; export {};