@uservane/vercel-ai: SurveyDefinition
Type Alias: SurveyDefinition
Section titled “Type Alias: SurveyDefinition”SurveyDefinition =
object
Defined in: products/uservane/browser/dist/index.d.ts:24
@uservane/vercel-ai - agent-native capture for Vercel AI SDK hosts.
Thin positioning shim over @uservane/agent-core + @uservane/agent-react.
Headless core (AgentController) + React <UserVaneProvider> / <InlineFeedback/>.
Reuses @uservane/browser for bootstrap, decideShow, submit. Does not reimplement
show-token, suppression, or sampling.
Session correlation (production linked path):
- Server:
import { mintFeedbackToken } from "@uservane/vercel-ai/server"with the project SECRET key + the same sessionId passed to Langfuse propagateAttributes. - Thread showToken + sessionId to the client.
- Client:
controller.bind({ surveyId, showToken, sessionId })then resolveTask. Submit carries the bound token + sessionId -> response storedlinked.
Without bind(), the unbound bootstrap path still works (stored unlinked).
Do not import the /server entry from client code (secret key must stay server-side).
Observation-level auto-read remains deferred.
// NEEDS CEO VERIFICATION: observation-level auto-read (deferred)
import { UserVaneProvider, useUserVane } from "@uservane/vercel-ai";
<UserVaneProvider apiKey="uv_pk_live_..." surveySlug="post-task"> <Chat /></UserVaneProvider>
// after server mints a bound token:controller.bind({ surveyId, showToken, sessionId });// at true resolution:const { resolveTask } = useUserVane();resolveTask({ outcome: "refunded" });Headless-only: construct AgentController with headlessMode: true and supply
setHeadlessContract({ isTaskOpen, onDismiss }) or shows are refused.
Properties
Section titled “Properties”corner?
Section titled “corner?”
optionalcorner?:Corner
Defined in: products/uservane/browser/dist/index.d.ts:32
delayMs?
Section titled “delayMs?”
optionaldelayMs?:number
Defined in: products/uservane/browser/dist/index.d.ts:38
Fixed delay (ms) after page-idle before auto appearance. Fires once. Not idle-detection hunting. Default 8000.
endLabels?
Section titled “endLabels?”
optionalendLabels?:object
Defined in: products/uservane/browser/dist/index.d.ts:44
high:
string
low:
string
followUpQuestion?
Section titled “followUpQuestion?”
optionalfollowUpQuestion?:string
Defined in: products/uservane/browser/dist/index.d.ts:30
Optional free-text follow-up. Always skippable.
id:
string
Defined in: products/uservane/browser/dist/index.d.ts:25
presentation
Section titled “presentation”presentation:
Presentation
Defined in: products/uservane/browser/dist/index.d.ts:31
question
Section titled “question”question:
string
Defined in: products/uservane/browser/dist/index.d.ts:28
samplePercent?
Section titled “samplePercent?”
optionalsamplePercent?:number
Defined in: products/uservane/browser/dist/index.d.ts:40
Deterministic audience sampling 0–100. Default 100.
showBadge?
Section titled “showBadge?”
optionalshowBadge?:boolean
Defined in: products/uservane/browser/dist/index.d.ts:43
Free plan shows a small “Powered by UserVane” link.
slug:
string
Defined in: products/uservane/browser/dist/index.d.ts:26
targeting?
Section titled “targeting?”
optionaltargeting?:TraitPredicate[]
Defined in: products/uservane/browser/dist/index.d.ts:41
trigger
Section titled “trigger”trigger:
Trigger
Defined in: products/uservane/browser/dist/index.d.ts:33
type:
SurveyType
Defined in: products/uservane/browser/dist/index.d.ts:27