@pouchy_ai/companion-sdk - v0.78.1
    Preparing search index...

    Type Alias CallCredentials

    CallCredentials:
        | {
            agentId: string;
            audioTags?: boolean;
            callGen?: string;
            firstMessage?: string;
            instructions: string;
            language?: string;
            privateStory?: CallPrivateStory;
            provider: "elevenlabs-convai";
            recording?: boolean;
            recordingUnavailable?: CallRecordingUnavailable;
            token: string;
            trimmed?: CallTrimmed;
            video?: CallVideo;
            videoUnavailable?: CallVideoUnavailable;
            voice?: string;
            voiceToolToken?: string;
            worldBrief?: CallWorldBrief;
        }
        | {
            callGen?: string;
            clientSecret: string;
            expiresAt: number
            | null;
            model: string;
            privateStory?: CallPrivateStory;
            provider: "openai-realtime";
            recording?: boolean;
            recordingUnavailable?: CallRecordingUnavailable;
            trimmed?: CallTrimmed;
            video?: CallVideo;
            videoUnavailable?: CallVideoUnavailable;
            voice: string;
            worldBrief?: CallWorldBrief;
        }

    Voice-plane credentials, discriminated by provider (see startCall).

    Type Declaration

    • {
          agentId: string;
          audioTags?: boolean;
          callGen?: string;
          firstMessage?: string;
          instructions: string;
          language?: string;
          privateStory?: CallPrivateStory;
          provider: "elevenlabs-convai";
          recording?: boolean;
          recordingUnavailable?: CallRecordingUnavailable;
          token: string;
          trimmed?: CallTrimmed;
          video?: CallVideo;
          videoUnavailable?: CallVideoUnavailable;
          voice?: string;
          voiceToolToken?: string;
          worldBrief?: CallWorldBrief;
      }
      • agentId: string
      • OptionalaudioTags?: boolean

        true when this call was granted Eleven v4 performed cues (startCall({ audioTags: true }), 0.64.0): instructions then teach the model [laughs] / [whispers] and the transcript carries them — strip them with stripAudioTags before you show or store a line. connectCall does that for you. ABSENT when not granted.

      • OptionalcallGen?: string

        Generation handle of the call-active window this mint stamped (0.41.0). Self-plumbed integrations: pass it to endSession({ callGen }) at call end so the server clears exactly this call's window — a stale handle's late teardown then can't clear a newer call's window. connectCall() handles this automatically.

      • OptionalfirstMessage?: string

        First-message override ('' = suppress the canned greeting so the call opens in-character / context-aware). Pass as overrides.agent.firstMessage.

      • instructions: string

        Pass as overrides.agent.prompt.prompt when starting the EL session.

      • Optionallanguage?: string

        Server-resolved agent language (ISO 639-1, e.g. 'zh'). Pass as overrides.agent.language so the call opens in the user's language.

      • OptionalprivateStory?: CallPrivateStory

        Pouchy World role sessions only (0.68.0): whether the role can reach its private layer during this call (see CallPrivateStory). ABSENT on an ordinary session.

      • provider: "elevenlabs-convai"
      • Optionalrecording?: boolean

        Whether this call is recorded (startCall({ record: true }), 0.65.0). Present only when the call asked. true means the provider keeps the whole call (both voices) and getCallRecording(callGen) will return it after the call ends.

      • OptionalrecordingUnavailable?: CallRecordingUnavailable

        Why a call that asked to be recorded is not (0.65.0). Tell the reader BEFORE the call connects.

      • token: string

        EL conversation token (open WebRTC with @elevenlabs/client).

      • Optionaltrimmed?: CallTrimmed

        What the server cut to keep instructions within the realtime cap (0.68.0; see CallTrimmed). ABSENT when nothing was cut.

      • Optionalvideo?: CallVideo

        A talking-face video avatar for this call (0.75.0), present when the call asked (startCall({ avatar: { faceId } })) and got one. Open it with simli-client: new SimliClient(video.sessionToken, videoEl, audioEl, video.iceServers), then feed it the companion's remote audio track (listenToMediastreamTrack). The voice still comes from this call; the face only lip-syncs to it.

      • OptionalvideoUnavailable?: CallVideoUnavailable

        Why a call that asked for an avatar has none (0.75.0). The call is voice-only; tell the reader before it connects.

      • Optionalvoice?: string

        Server-resolved EL voice id (the user's cloned/localized voice). Pass as overrides.tts.voiceId so the call isn't a stock default voice.

      • OptionalvoiceToolToken?: string

        Call-scoped bearer the agent's memory webhook tool presents back to us mid-call (0.45.0). Self-plumbed integrations: pass it to Conversation.startSession under BOTH dynamic variable names (0.47.0) — dynamicVariables: { [VOICE_TOOL_VARIABLE]: creds.voiceToolToken, [VOICE_TOOL_VARIABLE_PLAIN]: creds.voiceToolToken }. ElevenLabs IGNORES a client-supplied secret__ variable, so the plain twin is the one that arrives; it reaches the tool as a request-body property the platform fills, never as prompt content the LLM sees. Passing only the first name raises no error — it just leaves the companion unable to recall anything. connectCall() handles this automatically.

        ABSENT, not empty, when the session cannot read memory: a client with no memory grant has nothing to pass, rather than something that fails inside a live call. Omitting it does not break the call — recall just answers "no stored memory".

      • OptionalworldBrief?: CallWorldBrief

        Pouchy World role sessions only (0.67.0): whether the call carries the story's current state (see CallWorldBrief). ABSENT on an ordinary session.

    • {
          callGen?: string;
          clientSecret: string;
          expiresAt: number | null;
          model: string;
          privateStory?: CallPrivateStory;
          provider: "openai-realtime";
          recording?: boolean;
          recordingUnavailable?: CallRecordingUnavailable;
          trimmed?: CallTrimmed;
          video?: CallVideo;
          videoUnavailable?: CallVideoUnavailable;
          voice: string;
          worldBrief?: CallWorldBrief;
      }
      • OptionalcallGen?: string

        See the elevenlabs-convai branch — same window-generation handle.

      • clientSecret: string

        Ephemeral client secret (ek_…); open WebRTC directly to OpenAI.

      • expiresAt: number | null
      • model: string
      • OptionalprivateStory?: CallPrivateStory

        Always 'none' on a world session here (0.68.0): the OpenAI Realtime fallback has no webhook tools.

      • provider: "openai-realtime"
      • Optionalrecording?: boolean

        OpenAI Realtime keeps no recording: false whenever the call asked (0.65.0), with recordingUnavailable saying why.

      • OptionalrecordingUnavailable?: CallRecordingUnavailable
      • Optionaltrimmed?: CallTrimmed

        See the elevenlabs-convai branch (0.68.0).

      • Optionalvideo?: CallVideo

        See the elevenlabs-convai branch (0.75.0).

      • OptionalvideoUnavailable?: CallVideoUnavailable
      • voice: string
      • OptionalworldBrief?: CallWorldBrief

        See the elevenlabs-convai branch (0.67.0).