HCC Docs

Live translation

Captions between the customer and the rep are off until you deploy a translation policy, one per environment. Every translated call hears the notice first.

import { defineTranslationPolicy } from '@hccrun/sdk';

// Exported, so `hcc deploy` deploys it. Lower-level: `hcc.translation.deploy(translation)`.
export const translation = defineTranslationPolicy({
  repMayStart: true,
  keepTranscript: true, // keep the lines; off by default
});

await hcc.calls.translation.start(callId, { customer: 'es' }); // notice, then captions
await hcc.calls.translation.stop(callId);
await hcc.calls.translations(callId); // each stretch, with its lines if kept

Without keepTranscript, captions go to the rep's Desk and nothing is kept. With it, each stretch's final lines (who spoke, what they said, the translation, the language and when) are kept under the recording policy's transcript retention for the call's environment, or 365 days without a recording policy. hcc.recording.delete(callId) removes them with the audio. call.translation.* events and logs never carry the text; read it with a key that has calls:read.