🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@itannix/vue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itannix/vue

Vue SDK for ItanniX Voice AI platform

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

@itannix/vue

Vue SDK for the ItanniX Voice AI platform. Add real-time voice interactions to your Vue app with a simple composable or component.

Installation

npm install @itannix/vue

Quick Start (Composable)

<template>
  <div>
    <p>Status: {{ status }}</p>
    <button @click="connect" :disabled="status !== 'disconnected'">
      Connect
    </button>
    <button @click="disconnect" :disabled="status === 'disconnected'">
      Disconnect
    </button>
    <div v-for="(msg, i) in messages" :key="i">
      <p><strong>{{ msg.role }}:</strong> {{ msg.text }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { useVoiceClient } from '@itannix/vue';

const messages = ref<Array<{ role: string; text: string }>>([]);

const { status, connect, disconnect, sendFunctionResult } = useVoiceClient({
  workspaceKey: 'your-workspace-key',
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  onTranscript: (text) => {
    messages.value.push({ role: 'user', text });
  },
  onAssistantMessage: (text, done) => {
    if (done) {
      messages.value.push({ role: 'assistant', text });
    }
  },
  onFunctionCall: (name, args, callId) => {
    sendFunctionResult(callId, { success: true });
  },
  onError: (error) => {
    console.error('Connection error:', error);
  }
});
</script>

Quick Start (Component)

<template>
  <div>
    <VoiceAssistant
      ref="assistantRef"
      workspace-key="your-workspace-key"
      client-id="your-client-id"
      client-secret="your-client-secret"
      @status-change="handleStatusChange"
      @transcript="handleTranscript"
      @assistant-message="handleAssistantMessage"
    />
    <p>Status: {{ status }}</p>
    <button @click="assistantRef?.connect()">Connect</button>
    <button @click="assistantRef?.disconnect()">Disconnect</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { VoiceAssistant } from '@itannix/vue';
import type { ConnectionStatus } from '@itannix/vue';

const assistantRef = ref<InstanceType<typeof VoiceAssistant> | null>(null);
const status = ref<ConnectionStatus>('disconnected');

function handleStatusChange(newStatus: ConnectionStatus) {
  status.value = newStatus;
}

function handleTranscript(text: string) {
  console.log('You:', text);
}

function handleAssistantMessage(text: string, done: boolean) {
  if (done) console.log('Assistant:', text);
}
</script>

Composable Options

OptionTypeRequiredDescription
workspaceKeystringYesYour workspace API key from workspace settings
clientIdstringYesYour ItanniX client ID
clientSecretstringYesYour client secret
serverUrlstringNoAPI server URL (default: https://api.itannix.com)
onTranscript(text: string) => voidNoCalled when user speech is transcribed
onAssistantMessage(text: string, done: boolean) => voidNoCalled with assistant response (streaming)
onFunctionCall(name, args, callId) => voidNoCalled when assistant invokes a function
onError(error: Error) => voidNoCalled on connection errors

Composable Return Value

PropertyTypeDescription
statusRef<ConnectionStatus>Current connection status (reactive)
connect() => Promise<void>Start voice connection
disconnect() => voidEnd voice connection
sendFunctionResult(callId, result) => voidSend function call result back to assistant

Component Props

PropTypeRequiredDescription
workspaceKeystringYesYour workspace API key from workspace settings
clientIdstringYesYour ItanniX client ID
clientSecretstringYesYour client secret
serverUrlstringNoAPI server URL

Component Events

EventPayloadDescription
statusChangeConnectionStatusConnection status changed
transcriptstringUser speech transcribed
assistantMessage{ text: string, done: boolean }Assistant response (streaming)
functionCall{ name: string, args: object, callId: string }Function call from assistant
errorErrorConnection or runtime error

Component Methods

Access via template ref:

<VoiceAssistant ref="assistantRef" ... />

<script setup>
const assistantRef = ref();

// Connect
assistantRef.value?.connect();

// Disconnect
assistantRef.value?.disconnect();

// Send function result
assistantRef.value?.sendFunctionResult(callId, { success: true });

// Get status
console.log(assistantRef.value?.status);
</script>

License

MIT

Keywords

vue

FAQs

Package last updated on 04 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts