Collection of functions responsible for tracking user activity in an Eitri-App using the Synerise SDK (CRM / customer engagement platform).

This module exposes user-activity tracking and push opt-in only. Event delivery is handled by the SDK's own batching/auto-flush schedule — there is no manual flush to call.

The wider Synerise integration also covers user identification and push notifications, but those have no dedicated bridge surface here: identity is driven by session.notifyLogin / session.notifyLogout, and push registration/receipt is wired natively. In-app messaging (Injector campaigns), Content/Recommendations and Promotions are not integrated.

Requirements: This feature must be enabled in the Eitri Shopping App native configuration by providing the synerise configuration (Profile API key and tenant base URL) in the app configuration file.

User identity is not set here, but in session.notifyLogin and session.notifyLogout.

Methods

  • Logs an add-to-cart using Synerise's built-in product.addToCart event.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logAddedToCart({
    label: "Add to cart",
    sku: "SKU-123",
    finalPrice: 49.9,
    currency: "BRL",
    quantity: 2,
    })

    Parameters

    • param: {
          category?: string;
          currency?: string;
          data?: Record<string, string | number | boolean>;
          discountedPrice?: number;
          finalPrice: number;
          label: string;
          name?: string;
          offline?: boolean;
          producer?: string;
          quantity?: number;
          regularPrice?: number;
          sku: string;
          url?: string;
      }

      Object describing the cart addition.

      • Optionalcategory?: string

        Optional product category.

      • Optionalcurrency?: string

        ISO 4217 code (for example BRL) applied to every price in this call. When absent or unrecognised, the device's default currency is used.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • OptionaldiscountedPrice?: number

        Optional discounted unit price.

      • finalPrice: number

        Unit price actually charged.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

      • Optionalname?: string

        Optional product name.

      • Optionaloffline?: boolean

        Optional flag marking the event as originating offline.

      • Optionalproducer?: string

        Optional producer/brand.

      • Optionalquantity?: number

        Quantity added. Defaults to 1.

      • OptionalregularPrice?: number

        Optional pre-discount unit price.

      • sku: string

        Product identifier (SKU).

      • Optionalurl?: string

        Optional product URL.

    Returns Promise<undefined>

  • Logs a favorite using Synerise's built-in product.addToFavorite event.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logAddedToFavorites({
    label: "Add to favorites",
    data: { sku: "SKU-123" },
    })

    Parameters

    • param: { data?: Record<string, string | number | boolean>; label: string }

      Object describing the event.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

    Returns Promise<undefined>

  • Logs a geographic appearance using Synerise's built-in client.location event.

    The coordinates must be supplied by the Eitri-app — this call does not read the device's location. Obtain them through Eitri.geolocation first, respecting the permission flow.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logAppearedInLocation({
    label: "Store visit",
    latitude: -23.5505,
    longitude: -46.6333,
    })

    Parameters

    • param: {
          data?: Record<string, string | number | boolean>;
          label: string;
          latitude: number;
          longitude: number;
      }

      Object describing the event.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

      • latitude: number

        Latitude in decimal degrees.

      • longitude: number

        Longitude in decimal degrees.

    Returns Promise<undefined>

  • Logs an event with the Synerise SDK as a custom event, where each parameter of the event is defined as a key-value pair within the data object.

    The eventName must follow Synerise's action grammar: a context.action form (for example screen.view, product.buy, social.share) of at most 32 characters. Names that do not match are dropped and logged natively, never truncated — a truncated action would register as a different event in the Synerise dashboard. This constraint is specific to Synerise; other SDKs receive event names verbatim.

    Never send transaction.charge through this method — the vendor reserves it for the dedicated purchase event, which this integration does not expose.

    Example:

    const modules = await Eitri.modules();
    const logEvent = modules?.synerise?.logEvent;
    if (!logEvent) return;

    await logEvent({
    eventName: "product.view",
    data: {
    sku: "sku-001",
    price: 29.99,
    currency: "BRL"
    }
    })

    Parameters

    • param: { data: Record<string, string | number | boolean>; eventName: string }

      Object describing the event.

      • data: Record<string, string | number | boolean>

        Object describing the event's data.

      • eventName: string

        Action name of the event, in context.action form, max 32 chars.

    Returns Promise<undefined>

  • Logs a product view using Synerise's built-in product.view event.

    Prefer this over logEvent for the events below: the SDK owns the action name, so it is not subject to the context.action grammar or the 32-character limit, and the typed fields land in the slots Synerise's recommendation and segmentation engines actually read. Anything outside those slots goes in data and is sent as event parameters.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logProductView({
    label: "Product view",
    productId: "SKU-123",
    productName: "Tênis Runner",
    category: "Calçados",
    })

    Parameters

    • param: {
          category?: string;
          data?: Record<string, string | number | boolean>;
          label: string;
          productId: string;
          productName: string;
          url?: string;
      }

      Object describing the product view.

      • Optionalcategory?: string

        Optional product category.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

      • productId: string

        Product identifier (SKU).

      • productName: string

        Product name.

      • Optionalurl?: string

        Optional product URL.

    Returns Promise<undefined>

  • Logs a cart removal using Synerise's built-in product.removeFromCart event.

    Takes the same fields as logAddedToCart.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logRemovedFromCart({
    label: "Remove from cart",
    sku: "SKU-123",
    finalPrice: 49.9,
    currency: "BRL",
    quantity: 1,
    })

    Parameters

    • param: {
          category?: string;
          currency?: string;
          data?: Record<string, string | number | boolean>;
          discountedPrice?: number;
          finalPrice: number;
          label: string;
          name?: string;
          offline?: boolean;
          producer?: string;
          quantity?: number;
          regularPrice?: number;
          sku: string;
          url?: string;
      }

      Object describing the cart removal.

      • Optionalcategory?: string

        Optional product category.

      • Optionalcurrency?: string

        ISO 4217 code (for example BRL) applied to every price in this call. When absent or unrecognised, the device's default currency is used.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • OptionaldiscountedPrice?: number

        Optional discounted unit price.

      • finalPrice: number

        Unit price actually charged.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

      • Optionalname?: string

        Optional product name.

      • Optionaloffline?: boolean

        Optional flag marking the event as originating offline.

      • Optionalproducer?: string

        Optional producer/brand.

      • Optionalquantity?: number

        Quantity removed. Defaults to 1.

      • OptionalregularPrice?: number

        Optional pre-discount unit price.

      • sku: string

        Product identifier (SKU).

      • Optionalurl?: string

        Optional product URL.

    Returns Promise<undefined>

  • Logs a search using Synerise's built-in client.search event.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logSearched({
    label: "tênis running",
    data: { results: 42 },
    })

    Parameters

    • param: { data?: Record<string, string | number | boolean>; label: string }

      Object describing the event.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        The search term, as shown in the Synerise dashboard.

    Returns Promise<undefined>

  • Logs a share using Synerise's built-in client.shared event.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logShared({ label: "Product shared" })

    Parameters

    • param: { data?: Record<string, string | number | boolean>; label: string }

      Object describing the event.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        Human-readable event label shown in the Synerise dashboard.

    Returns Promise<undefined>

  • Logs a screen view using Synerise's built-in screen.view event.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.logVisitedScreen({ label: "ProductDetail" })

    Parameters

    • param: { data?: Record<string, string | number | boolean>; label: string }

      Object describing the event.

      • Optionaldata?: Record<string, string | number | boolean>

        Optional extra event parameters.

      • label: string

        Screen name, as shown in the Synerise dashboard.

    Returns Promise<undefined>

  • Updates the user's consent for mobile push campaigns.

    The push token is resolved natively — it is not part of this call, and is not available to an Eitri-app.

    If the device has no push token stored yet, the consent is persisted natively and sent to Synerise as soon as the token is registered, so it is never lost.

    Example:

    const modules = await Eitri.modules();
    await modules?.synerise?.setUserOptins({ push: false })

    Parameters

    • param: { push: boolean }

      Object describing the opt-ins.

      • push: boolean

        Whether the user consents to mobile push campaigns. Required: there is no default, and a missing or non-boolean value makes the call a no-op rather than assuming either consent or refusal.

    Returns Promise<undefined>