Perfox Widget Test Bench

disconnected no ws anonymous

Injects the real widget bundle (<api>/widget/v1/widget.js) against any tenant/Site. Drive user context on the fly — client (SDK) and server (the auth-context broker) — watch what the platform resolved, and log/simulate chat-triggered drive_ui commands. This page's origin () must be in the Site's Allowed origins or /init returns 403.

① Drive context

Client — Perfox('identify' | 'update')

user_context.attributes — the tenant's opaque string→string bag. Doubles as perfox_resolve resolver fields (e.g. membership_id) + forwarded to MCP tools.

Identify replaces identity; Update shallow-merges (missing keys preserved) — the "one field at a time" client path. Both attach to the next turn.

Server — broker "like the server sends"

⚠ TEST-ONLY: pasting a tenant sk_ key signs here in-browser. A real integrator keeps the key server-side and calls POST /conversations/:id/auth-context from its own backend.

user_context to merge (display identity)

forward_payload (opaque, business-signed)

POSTs to <api>/conversations/<conv>/auth-context. On a web login transition the platform fires a hidden login turn — watch it arrive over the reply WS below.

② Resolution & traffic

Resolution inspector

conversation_id customer_id identity signal auth_level (/init request trust) auth_state (broker) workflow_id

Client resume state

conv (localStorage) pending send tab_id (session)

Variables sent the round-trip

Last /init · user_context

Last /send · user_context

Last server push · auth-context

Network log

③ UI commands (drive_ui)

Taps & handlers

Requires the Site's Web-Chat trigger to have UI commands enabled + an allowed events list. Frames are logged straight off the reply WebSocket (wire tap); each built-in also gets a real Perfox('on:ui', …, {same_origin_only:false}) handler that drives the sandbox.

Simulated handlers (registered on Connect)

Command log every ui:command frame

Mock host sandbox safe simulation

What a real host page would do when the agent drives these commands:
mock form (#sb-form)
highlight targets
.promo
Mock modal
opened by an open_modal command

Legend: navigate shows the target (open it manually); highlight flashes a matched element; prefill_form fills the mock inputs; open/close_modal toggles the modal; scroll_to/trigger_login/refresh_data annotate the log.