@uservane/vercel-ai/server: MintFeedbackTokenInput
Type Alias: MintFeedbackTokenInput
Section titled “Type Alias: MintFeedbackTokenInput”MintFeedbackTokenInput =
object
Defined in: server.d.ts:31
@uservane/agent-core/server - server-only helpers for agent-native capture.
SECURITY: This module MUST run only on the customer’s server (Next.js route handler / server action / edge function). It accepts the project SECRET key and POSTs to /v1/sdk/tokens. Never import this entry from client components or ship the secret key to the browser.
Correlation model (verified, 2026-07-27):
- Langfuse accepts session-level scores (sessionId alone).
- Observation-level scores need developer-provided traceId + observationId.
- Mint a token bound to those ids, then thread showToken + ids to the client for controller.bind(). Framework auto-read of trace/observation ids is deferred (developer-provided path only).
Example
Section titled “Example”import { mintFeedbackToken } from "@uservane/agent-core/server";
const { tokens } = await mintFeedbackToken({ secretKey: process.env.USERVANE_SECRET_KEY!, respondentId: userId, sessionId, // optional: per-step observation score // observationId, traceId, surveyId: "surv_post_task",});// thread tokens[surveyId] + sessionId (+ optional traceId/observationId) to bind()Properties
Section titled “Properties”allowModelRequested?
Section titled “allowModelRequested?”
optionalallowModelRequested?:boolean
Defined in: server.d.ts:58
Issuer opt-in for the request_user_feedback agent tool. When true, each minted token attests amr:true so model-requested submits are accepted. Default false: the model cannot self-enable the tool. Enabling carries a self-selection warning: model-requested captures are headline-excluded (identity_kind=model-requested).
apiBase?
Section titled “apiBase?”
optionalapiBase?:string
Defined in: server.d.ts:60
API origin. Defaults to https://api.uservane.com.
fetchImpl?
Section titled “fetchImpl?”
optionalfetchImpl?: typeoffetch
Defined in: server.d.ts:62
Injected fetch (tests).
observationId?
Section titled “observationId?”
optionalobservationId?:string
Defined in: server.d.ts:43
respondentId
Section titled “respondentId”respondentId:
string
Defined in: server.d.ts:35
Respondent identity (identified userId or server-known anon key).
secretKey
Section titled “secretKey”secretKey:
string
Defined in: server.d.ts:33
Project secret key (uv_sk_...). NEVER ship to the browser.
sessionId
Section titled “sessionId”sessionId:
string
Defined in: server.d.ts:40
Authoritative session id - the same value passed to Langfuse propagateAttributes. Bound into the show-token server-side.
surveyId?
Section titled “surveyId?”
optionalsurveyId?:string
Defined in: server.d.ts:42
Optional: limit mint to one survey.
taskType?
Section titled “taskType?”
optionaltaskType?:string
Defined in: server.d.ts:50
Untrusted display metadata for PM segmentation.
traceId?
Section titled “traceId?”
optionaltraceId?:string
Defined in: server.d.ts:48
Authoritative trace id for observation-level scores. Pair with observationId. Developer-provided only; framework auto-read remains deferred.