claudius-chat-widget
    Preparing search index...

    Type Alias Trigger

    Trigger:
        | {
            action: TriggerAction;
            matchUrl?: UrlPattern;
            on: "time";
            seconds: number;
        }
        | {
            action: TriggerAction;
            matchUrl?: UrlPattern;
            on: "scroll";
            percent: number;
        }
        | { action: TriggerAction; matchUrl?: UrlPattern; on: "exit-intent" }
        | { action: TriggerAction; on: "url"; pattern: UrlPattern }

    A proactive engagement rule. Each variant fires at most once per page on a different signal: elapsed time, scroll depth, exit intent, or URL match.

    Type Declaration

    • { action: TriggerAction; matchUrl?: UrlPattern; on: "time"; seconds: number }
      • action: TriggerAction

        Action to run when the trigger fires.

      • OptionalmatchUrl?: UrlPattern

        Only fire when the current URL matches this pattern.

      • on: "time"

        Fire after a fixed dwell time.

      • seconds: number

        Seconds to wait before firing.

    • { action: TriggerAction; matchUrl?: UrlPattern; on: "scroll"; percent: number }
      • action: TriggerAction

        Action to run when the trigger fires.

      • OptionalmatchUrl?: UrlPattern

        Only fire when the current URL matches this pattern.

      • on: "scroll"

        Fire once the user scrolls past a depth threshold.

      • percent: number

        Scroll depth (0-100) that fires the trigger.

    • { action: TriggerAction; matchUrl?: UrlPattern; on: "exit-intent" }
      • action: TriggerAction

        Action to run when the trigger fires.

      • OptionalmatchUrl?: UrlPattern

        Only fire when the current URL matches this pattern.

      • on: "exit-intent"

        Fire when the pointer leaves the top of the viewport (exit intent).

    • { action: TriggerAction; on: "url"; pattern: UrlPattern }
      • action: TriggerAction

        Action to run when the trigger fires.

      • on: "url"

        Fire immediately when the current URL matches.

      • pattern: UrlPattern

        URL pattern that must match for the trigger to fire.