Building a Real-time Translated Live Community in 10 Minutes with 1 API Key
Back to Blog
Tutorial
Developer Experience
SDK
Translation

Building a Real-time Translated Live Community in 10 Minutes with 1 API Key

HyperBabel Engineering Team

Building a Real-time Translated Live Community in 10 Minutes

💡 Target Audience: Developers and technical leads tired of stitching together multiple disjointed APIs.

How is 10 Minutes Possible?

In the past, building a multi-lingual live chat required: [Building Socket Servers] + [Designing Chat DB] + [Integrating a Translation API] + [Adding Video SDK].

HyperBabel provides an All-in-One API where all these layers are already integrated behind one key. A handful of REST calls from your frontend is enough to prototype — there is no SDK package to install.

Step 1: The Magic of Initialization

No messy token exchanges to start prototyping. One API key gives you full control, and every call is a plain HTTPS request.

const HB_API = 'https://api.hyperbabel.com/api/v1';

// Prototype only: in production this key never ships in the client (see below).
async function hb(path, body) {
  const res = await fetch(HB_API + path, {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY_HERE',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`HyperBabel ${res.status}`);
  return res.json();
}

Step 2: Enable Real-Time AI Translation

Whether the user types in French or Korean, the message is sent once and each reader gets it in their own language — the reading client asks for its language (read it from the device locale). Zero backend setup required.

// Create a room — the creator joins automatically
const { room } = await hb('/unitedchat/rooms', {
  room_type: 'group',
  room_name: 'Global Room 1',
  creator_id: 'user_seoul',
  members: ['user_paris', 'user_madrid'],
});

// Send once, in whatever language the sender writes
const { message } = await hb(`/unitedchat/rooms/${room.id}/messages`, {
  sender_id: 'user_seoul',
  content: 'Hello! I am connecting from Seoul.',
});

// Each reader asks for its own language
const { translations } = await hb(`/unitedchat/rooms/${room.id}/messages/batch-translate`, {
  message_ids: [message.id],
  target_lang: 'fr', // e.g. from navigator.language
});
// translations → { [message.id]: '…the French text…' }

Step 3: Flip the Switch for HD Video

"Let's talk face to face." One more call starts an HD video call inside the same room.

// 1:1 HD call in the same room (paid plans; calls with 3+ people need Scale)
const { session, caller } = await hb(`/unitedchat/rooms/${room.id}/video-call`, {
  caller_id: 'user_seoul',
  target_user_ids: ['user_paris'],
  quality: 'hd',
});
// caller carries the media token your video client joins with —
// the open-source sample apps include a complete call screen.

Where the ten minutes actually go

"Ten minutes" is only useful if it survives contact with a real machine. Here is the honest budget, assuming you already have a project to paste into:

StepRealistic time
Sign up and copy an API key~2 min
Set up the request helper~1 min
Create a room and send a translated message~3 min
Add the video session call~2 min
Render whatever your UI needsthe rest of your afternoon

That last row is the honest part. The infrastructure takes ten minutes; the interface is still your job. We ship the API and open-source reference demos, not a drop-in component kit — if you expected finished screens, budget accordingly.

🔴 Before you ship: do not put your API key in the client

The snippets above use your organisation API key directly, which is exactly right for a prototype on your own machine and exactly wrong in production. A key shipped inside a mobile or web bundle can be extracted, and it carries your whole organisation's authority.

For production, use Customer Auth: your backend (or your existing identity provider) exchanges a signed user identity for a short-lived, per-end-user token — one hour for access, thirty days for refresh — scoped to that single user. The client never holds the organisation key, and revoking one user does not mean rotating everything.

This is a five-line change, not an architecture change, and it is the single most common thing teams forget between prototype and launch.

Three things that trip people up

  1. "Translation isn't appearing." Translation is requested by the reader, per message. If the reading client never asks for a target language, it shows the original text as-is — which is the correct behaviour, not a bug. Read the reader's language from the device locale and pass it as target_lang.
  2. "The video call connects but there's no audio." On mobile, microphone permission has to be granted *before* the session starts, and browsers require the call to begin from a user gesture. Both are platform rules, not HyperBabel behaviour.
  3. "It works locally but not in production." Almost always an origin restriction on the API key. Keys can be locked to specific origins; add your production domain before release, not after.

What to build next

Once the channel is live, the useful additions are ordered by effort:

  • Presence and typing indicators — already flowing on the channel, just render them.
  • File sharing — uploads are served from the edge and outbound transfer is not billed, so you can be generous with attachments.
  • Webhooks — push message and session events to your backend for analytics, moderation or billing.
  • Live streaming — same channel, same key, one more call.

The 30-second version

The ten minutes are real, and they buy you working infrastructure — chat, translation and video on one key. What they do not buy you is a finished product: the UI is yours, and the one thing you must change before launch is moving from an organisation API key to per-user tokens.

Frequently asked questions

Can I really ship this to production as written?

Not as written. The snippets use an organisation API key in the client, which is correct for a local prototype and unsafe in a shipped bundle. Before launch, switch to Customer Auth so each end user gets a short-lived token (1h access, 30d refresh) and the organisation key never leaves your server.

Do I need a backend to get started?

No — the prototype runs entirely from the client. You will want a small backend endpoint for production, but only to exchange a user identity for a per-user token. There is no chat server, database or media pipeline to operate.

What does HyperBabel not do for me?

The interface. HyperBabel ships the API and open-source reference demos rather than a drop-in UI kit, so message lists, call screens and layout are yours to build. Everything below that line — transport, history, presence, translation, media delivery — is handled.

Why is translation not showing up on my messages?

Translation is requested per message by the reader. If the reading client asks for no target language, the original text is shown unchanged, which is intended behaviour. Read the reader's locale on the client and pass it as target_lang.

Did you find this article helpful?

Related articles