Member Junction
    Preparing search index...

    Talks to the widget guest-session endpoints. One instance per mounted widget.

    Index

    Constructors

    Methods

    • RV5 "forget me": asks the server to archive this visitor's memory and clear the VisitorKey linkage. The caller is responsible for clearing the durable cookie afterward (clearVisitorKey). Public endpoint — the durable key is the proof. Never throws.

      Parameters

      • visitorKey: string

      Returns Promise<{ error?: string; notesArchived?: number; success: boolean }>

    • Mints a fresh guest session. Throws on a non-2xx / unsuccessful response.

      Parameters

      • OptionalvisitorKey: string

        the durable returning-visitor anchor from the first-party cookie, if present — the server uses it to chain this visit to the visitor's prior conversation (gated on the widget's RememberReturningVisitors toggle). Omit on a first visit; the server mints one when remembering is on.

      Returns Promise<WidgetSession>

    • W5 magic-link upgrade ("Verify it's you"): asks the server to email a verification link scoped to the widget's app. On success the visitor receives an email; clicking it redeems a VERIFIED session JWT (via the existing /magic-link/redeem). The host page hands that token back to the widget, which calls transport.UpdateToken(verifiedToken) to swap it in — the live conversationId is preserved because the transport holds it. Never throws; returns a structured result for the UI.

      Parameters

      • email: string

      Returns Promise<{ emailSent?: boolean; error?: string; success: boolean }>

    • RV4 (magic-link upgrade path): after the visitor verifies and the widget swaps in the VERIFIED token, promote their anonymous returning-visitor trail to the verified record. AUTHENTICATED — the verified token is sent as a Bearer credential; the server reads the verified email from it. Never throws; returns a structured result.

      Parameters

      • verifiedToken: string
      • visitorKey: string

      Returns Promise<{ error?: string; mergedConversations?: number; success: boolean }>