@uservane/vercel-ai/server: mintDeferredAskLink
Function: mintDeferredAskLink()
Section titled “Function: mintDeferredAskLink()”mintDeferredAskLink(
input):Promise<MintDeferredAskLinkResult>
Defined in: server.d.ts:158
Mint a deferred (out-of-band) ask for async / off-platform resolution (deferAsk).
TWO delivery modes, deliberately distinct (see the result type):
url: a hosted ask link for your own channel (email etc.). The capture is STANDALONE - not correlated to the agent session. UserVane has no email/SMS sender; you deliver the URL.showToken+sessionId: the SESSION-LINKED path. Bind them in the user’s next in-app session (controller.bind(...)) so the deferred capture correlates to the run and round-trips a Langfuse session score. A session-linked ask via the emailed URL (rather than an in-app bind) is a planned follow-up; it requires the hosted flow to attest the session, which it does not yet.
Last-mile non-intrusion contract (enforcement ends where your channel begins):
- Deliver exactly one ask per resolved outcome (no double-send).
- Deliver only after the true outcome is confirmed (not on “submitted”/“handed off”).
- When the ask lands in-app (follow-up session), it is subject to that surface’s open-task bar (never interrupts the user’s next task).
Reuses the hosted-link show-token mint (issueLinkShowToken) - no new token type.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<MintDeferredAskLinkResult>
Example
Section titled “Example”// After the outcome is confirmed off-platform (e.g. refund settled):const { url, showToken, sessionId } = await mintDeferredAskLink({ secretKey: process.env.USERVANE_SECRET_KEY!, respondentId: userId, surveyId: "surv_post_task", sessionId,});// Standalone deferred ask: put `url` in your confirmation email.// Session-linked deferred ask: thread showToken + sessionId to the user's next// in-app session and controller.bind({ surveyId, showToken, sessionId }).// Either way, do NOT fire an in-session resolveTask ask.