Getting Started

Choose your framework and follow the steps to add voice chat to your app.

1. Install the SDK

npm install @treyorr/voca-client

2. Create a Room

Create a room to get a shareable room ID:

import { VocaClient } from '@treyorr/voca-client';

const client = await VocaClient.createRoom({
  serverUrl: 'https://voca.vc',
  apiKey: 'T8izjz8JpcWa3mtuhOFwprVk77uZKIzn',
});

// Share this room ID with others
console.log('Room ID:', client.roomId);

// Connect to start voice chat
await client.connect();

3. Join an Existing Room

When someone shares a room ID with you:

import { VocaClient } from '@treyorr/voca-client';

const client = new VocaClient('room-id-here', {
  serverUrl: 'https://voca.vc',
  apiKey: 'T8izjz8JpcWa3mtuhOFwprVk77uZKIzn',
});

await client.connect();

// Listen for events
client.on('peer-joined', (peerId) => console.log('Peer joined:', peerId));
client.on('peer-left', (peerId) => console.log('Peer left:', peerId));

📌 Free API Key

The hosted service at voca.vc is free for anyone to use with this API key:

T8izjz8JpcWa3mtuhOFwprVk77uZKIzn

Running your own server? See self-hosting.