D-ID Client SDK - v3.0.0-0
    Preparing search index...

    Interface AnalyticsOptions

    What the SDK reports about the session, and where it goes.

    Pass it as AgentManagerOptions.analytics; every field is optional, and leaving the whole object out reports to D-ID's own project.

    The SDK posts an event to Mixpanel for each step of a session — connect, reconnect and disconnect, every message sent and answered, every speak(), mode change, rating, feedback, tool call, video start and stop, interrupt and error. Each event carries the agent id, the visitor id derived from externalId, the page URL, the screen size, the user agent, the SDK version and whatever additionalProperties added. Conversation text is included too: the agent's answer on agent-message-received, and the script on agent-speak. Set enabled: false to send nothing at all.

    Events that fail to post are buffered in memory (at most 50) and retried when the tab comes back online or becomes visible.

    const agentManager = await sdk.createAgentManager('agt_fumf1234', {
    auth: { type: 'key', clientKey: 'YOUR_CLIENT_KEY' },
    callbacks,
    analytics: { mixpanelKey: 'YOUR_MIXPANEL_TOKEN', additionalProperties: { plan: 'pro' } },
    });
    interface AnalyticsOptions {
        additionalProperties?: Record<string, unknown>;
        enabled?: boolean;
        mixpanelKey?: string;
    }
    Index
    additionalProperties?: Record<string, unknown>

    Extra properties merged into every analytics event the SDK sends.

    A flat object — use it to tag events with your own identifiers. More properties can be added later with enrichAnalytics(). A plan property here is also forwarded to the Agents API as end-user data when a Talks (V2) or Clips (V3) stream is created.

    enabled?: boolean

    Whether the SDK reports usage analytics at all. Set it to false to send nothing.

    true
    
    mixpanelKey?: string

    Mixpanel project token the SDK's analytics events are sent to.

    Defaults to D-ID's own project. Set it to send the SDK's events to your Mixpanel project instead.