@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Interface PresencePing

    Presence ("Live on the site"): where a visitor is right now, so the shop's staff can see who is on the site and, in the customer assistant, where a shopper in a conversation is.

    Push-only and silent: the platform answers 204 for anything with a valid visitorId and the SDK swallows every error, so a ping never breaks or slows the storefront. What is stored is pseudonymous and short-lived.

    Send it ONLY when the visitor has consented to statistics/analytics, on every page change and every 30 s while the page is visible, and leave: true (with keepalive) on pagehide and once when consent is revoked. Identity (visitorId/sessionId) is the caller's, as for tracking (in Nuxt the useTracking() cookies).

    interface PresencePing {
        cartId?: string;
        leave?: boolean;
        pageType?: string;
        path?: string;
        productSku?: string;
        sessionId?: string;
        visitorId: string;
    }
    Index
    cartId?: string

    The visitor's cart. Its token goes as x-cart-token (see PresencePingOptions.cartToken).

    leave?: boolean

    The visitor left (pagehide, consent revoked).

    pageType?: string

    "product" | "category" | "cart" | "checkout" | "home" | "search" | "content" …

    path?: string

    The page's path, WITHOUT query string or hash.

    productSku?: string

    The product on a product page.

    sessionId?: string

    Rolling session id (30 min inactivity window).

    visitorId: string

    Pseudonymous visitor id (the avvyr_visitor cookie). 8-64 of A-Z, a-z, 0-9, _ and -.