salesive-dev-tools/handoff does the whole dance: open, wait, close, and
validate.
openHandoff({ url, timeoutMs })
- Opens
urlin a popup and waits for it to report completion. - Accepts only a
salesive:handoff-completemessage whosesourceis that popup and whoseoriginmatches the URL’s origin. Anything else is ignored. - Resolves
{ ok, data }and closes the popup. - Rejects with
HandoffError:popup_blocked, withurlso you can offer a plain link instead.handoff_timeout, aftertimeoutMs(five minutes by default).
completeHandoff({ ok, data })
On the top level page you opened, call this when the work is done. It posts
{ type: "salesive:handoff-complete", ok, data } to the opener with the exact
opener origin and closes the window.
data small and free of secrets. It comes back into the embedded app, not
into a server.

