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

    Type Alias CallCredentials

    CallCredentials:
        | {
            agentId: string;
            callGen?: string;
            firstMessage?: string;
            instructions: string;
            language?: string;
            provider: "elevenlabs-convai";
            token: string;
            voice?: string;
            voiceToolToken?: string;
        }
        | {
            callGen?: string;
            clientSecret: string;
            expiresAt: number
            | null;
            model: string;
            provider: "openai-realtime";
            voice: string;
        }

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

    Type Declaration

    • {
          agentId: string;
          callGen?: string;
          firstMessage?: string;
          instructions: string;
          language?: string;
          provider: "elevenlabs-convai";
          token: string;
          voice?: string;
          voiceToolToken?: string;
      }
      • agentId: string
      • 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.

      • provider: "elevenlabs-convai"
      • token: string

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

      • 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".

    • {
          callGen?: string;
          clientSecret: string;
          expiresAt: number | null;
          model: string;
          provider: "openai-realtime";
          voice: string;
      }
      • 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
      • provider: "openai-realtime"
      • voice: string