Thankly SDK for JavaScript
    Preparing search index...

    Interface DecisionEnvelope

    The engagement decision (carried by widget_data on a send, engagement-content-blocks). Copy is flattened onto the envelope; enrichment is delivered as sibling widgets — poll ThanklyServerApi.getEngagementDecision for the assembled { experienceId, status, widgets } set.

    interface DecisionEnvelope {
        cached?: boolean;
        channel?: string;
        confidence?: number;
        decision: string;
        placeholders?: string[];
        playbook_id?: string;
        playbook_version?: number;
        reason?: string;
        retry_after?: string | null;
        text?: string | null;
        variants?: DecisionVariant[] | null;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index
    cached?: boolean

    Whether this decision was served from cache.

    channel?: string

    Delivery channel the decision targets.

    confidence?: number

    How strongly the model backs this recommendation, 0–1.

    decision: string

    The decision the playbook reached.

    placeholders?: string[]

    {{token}} fields the caller must resolve before delivery.

    playbook_id?: string

    Playbook identifier.

    playbook_version?: number

    Version of the playbook that produced the decision.

    reason?: string

    Why this item is recommended for this cart

    retry_after?: string | null

    Present on a defer decision: ISO timestamp to retry after.

    text?: string | null

    The message body (send only).

    variants?: DecisionVariant[] | null

    A/B bodies when variant_count > 1 (send only).