@personaai/sdkv0.9.0

Voice

Gemini Live — mint a ticket, then WebSocket directly to Persona

Voice

Mint a single-use ticket server-side, then connect from the browser:

ts
// Serverconst ticket = await userClient.voice.createSession(agent._id, {  contextOverride: 'Live page context ≤4000 chars',  context: { userTier: 'pro' }, // never shown to model, ≤2000 bytes});// → { ticket, wsUrl, expiresAt, session }
// Clientconst ws = new WebSocket(ticket.wsUrl); // ticket embedded, direct to Persona// For mid-call context refresh, send { type: 'voice.context', context: { ... } } over the open socket

In React, see useVoice({ agentId, threadId, contextOverride, context }) and updateContext (live refresh). See and .