memoPage, Offers & Add-Ons

Retrieve page details, offers, add-ons, and offer groups using the Limio SDK useCampaign hook and offer utilities.

The useCampaign hook is the primary way to access page-level data in your components. A Page in Limio acts as a container for offers and optional add-ons, and can store custom attributes that drive content, logic, or display behaviour.

import { useCampaign } from "@limio/sdk"

const { campaign, offers, addOns, groupValues, tag } = useCampaign()

Returns:

Field
Type
Description

campaign

CampaignInfo

Page metadata — name, path, and custom attributes

offers

ElasticOffer[]

Offers attached to this page

addOns

ElasticAddOn[]

Add-ons attached to this page

groupValues

OfferGroup[]

Group definitions configured at the offer level

tag

string

The tag the user entered the page with (for tracking)


Displaying offers

The most common pattern is to destructure offers from useCampaign and render a card for each one. Offers contain pricing, display attributes, product references, and attachments.

import React from "react"
import { useCampaign, useBasket } from "@limio/sdk"

const PricingPage = () => {
  const { offers = [] } = useCampaign()
  const { addOfferToBasket } = useBasket()

  return (
    <section>
      {offers.map((offer) => {
        const { display_name__limio, display_price__limio, cta_text__limio } =
          offer.data.attributes

        return (
          <div key={offer.id}>
            <h2>{display_name__limio}</h2>
            <p>{display_price__limio}</p>
            <button onClick={() => addOfferToBasket(offer)}>
              {cta_text__limio || "Subscribe"}
            </button>
          </div>
        )
      })}
    </section>
  )
}
chevron-rightExample offer objecthashtag

Grouping offers

Offers can be grouped by their group__limio attribute (e.g. "monthly" vs "yearly"). The groupOffers utility organises offers into labelled groups for tabbed or sectioned layouts.

Parameters:

Param
Type
Description

offers

ElasticOffer[]

The offers array from useCampaign

groupLabels

Group[]

Group definitions — typically from component props or groupValues

Each Group has { id: string, label: string, thumbnail?: string }.

Returns an array of GroupInfo objects:

Field
Type
Description

groupId

string

The group identifier (matches group__limio on offers)

id

string

Same as groupId

label

string

Display label for the group

offers

ElasticOffer[]

Offers belonging to this group

thumbnail

string

Optional thumbnail URL for the group

Offers without a group__limio attribute are placed in an "Other" group.

Example — tabbed pricing page with monthly/yearly toggle:

chevron-rightExample groupLabels and outputhashtag

Input groupLabels (typically passed as a component prop):

Output from groupOffers:


Add-ons

Add-ons are optional products attached to a page — typically upsells or extras that complement a base offer. Destructure addOns from useCampaign to access them. Add-ons share the same structure as offers, with a record_type of "add_on" and their own price__limio charges.

chevron-rightExample add-on objecthashtag

Page attributes

Access custom attributes configured on the page itself through campaign.attributes. These drive content, layout logic, or checkout behaviour.

chevron-rightExample campaign objecthashtag

Offer utility functions

The SDK exports additional utilities for working with offers. These are most commonly used in subscription management views rather than acquisition pages.

checkActiveOffers()

Filters an array of offers to return only those that are currently active based on their start and end dates.

Param
Type
Default
Description

offers

ElasticOffer[]

[]

Offers to filter

includeFuture

boolean

false

Include future-dated offers

useOfferInfo()

Extracts and normalises common offer attributes into a typed object — useful for rendering offer cards with consistent logic.

Returns:

Field
Type
Description

displayName

string

Product display name or group label

hasRecurringCharge

boolean

Whether the offer has a recurring price charge

isAutoRenew

boolean

Whether auto-renewal is enabled

allowMultibuy

boolean

Whether quantity selection is allowed

isDelivery

boolean

Whether the offer includes physical delivery

offerImage

Attachment

First image attachment on the offer

isGift

boolean

Whether this is a gift redemption offer

usesExternalPrice

boolean

Whether pricing is fetched externally

productNames

string[]

Names of products included in the offer

offerDescription

string

MMA description text


See also

Last updated

Was this helpful?