Skip to main content

Quickstart

This guide takes you from zero to a working audio call: get an API key, mint a token for a user on your backend, create a room, and join it from the browser.

Prerequisites​

  • An EthioConnect account — sign up free, no payment needed
  • Node.js 18+ for your backend
  • A web app (plain JavaScript or React) for your users

1. Create an API Key​

  1. Sign in to your dashboard.
  2. Open API Keys and create a key.
  3. Copy it and store it as an environment variable on your server, for example COMM_BAAS_API_KEY.
Keep the API key on your server

The API key can create rooms and mint tokens for any user. Never ship it in a web or mobile app — your apps only ever receive short-lived tokens from your backend.

2. Install the Server SDK​

On your backend:

npm install @comm-baas/server-sdk
import { CommBaasServer } from '@comm-baas/server-sdk';

const server = new CommBaasServer({
apiKey: process.env.COMM_BAAS_API_KEY!,
baseUrl: 'https://rtc.ethioconnect.net',
});

3. Create a Room​

const { room } = await server.rooms.create({
name: 'Team Standup',
max_participants: 10,
});

console.log('Room ID:', room.id);

Your plan sets the upper limit for max_participants — see Pricing.

4. Mint a Token for Your User​

Expose an endpoint on your backend that your app calls after the user signs in to your app:

// e.g. GET /api/ethioconnect-token, behind your own authentication
const { access_token, expires_in } = await server.auth.mintToken({
user_id: currentUser.id, // your own user ID
display_name: currentUser.name, // shown to other participants
});

return { token: access_token, expires_in };

Tokens are short-lived. The client SDKs accept a function, so they fetch a fresh token from this endpoint whenever they need one.

5. Join the Room from the Browser​

npm install @comm-baas/client-sdk livekit-client
import { CommBaasClient } from '@comm-baas/client-sdk';

const client = new CommBaasClient({
baseUrl: 'https://rtc.ethioconnect.net/v1',
token: async () => {
const res = await fetch('/api/ethioconnect-token');
return (await res.json()).token;
},
});

const room = await client.joinRoom(roomId, { audio: true });

room.on('rosterSnapshot', (participants) => {
console.log('In the room:', participants.map((p) => p.display_name));
});

room.on('participantJoined', (p) => {
console.log(`${p.display_name} joined`);
});

joinRoom() handles the join request, the signaling connection, the media connection (including TURN relays when a network needs them), and call-quality telemetry for you.

6. Use React Hooks (Optional)​

For React apps, use @comm-baas/react:

npm install @comm-baas/react @comm-baas/client-sdk livekit-client
import {
CommBaasProvider,
RoomProvider,
useParticipants,
useLocalMic,
AudioRenderer,
} from '@comm-baas/react';

async function fetchToken() {
const res = await fetch('/api/ethioconnect-token');
return (await res.json()).token;
}

function App({ roomId }: { roomId: string }) {
return (
<CommBaasProvider baseUrl="https://rtc.ethioconnect.net/v1" token={fetchToken}>
<RoomProvider roomId={roomId}>
<Room />
</RoomProvider>
</CommBaasProvider>
);
}

function Room() {
const participants = useParticipants();
const { isMuted, toggle } = useLocalMic();

return (
<div>
<h2>Participants ({participants.length})</h2>
<ul>
{participants.map((p) => (
<li key={p.user_id}>{p.display_name}</li>
))}
</ul>
<button onClick={toggle}>{isMuted ? 'Unmute' : 'Mute'}</button>
<AudioRenderer />
</div>
);
}

7. Receive Webhooks (Optional)​

To react to calls on your backend — a user leaving, a room closing, a recording finishing — add an endpoint under Webhooks in your dashboard. Every delivery is HMAC-signed so you can verify it came from EthioConnect. See Webhooks for signature checking and every event payload.

Next Steps​