Headless API
SDK reference
weaverse-hydrogen
Package root
namespaces
JoyLoyaltyWidget

JoyLoyaltyWidget

Interfaces

LoyaltyWidgetLoaderData

Loader payload — only public config; the balance is client-filled.

Extends

Properties

apiUrl
apiUrl: string | null;
eligibility?
eligibility?: JoyCustomerLoyaltyEligibility;

The shop's setting, forwarded so the component knows whether the post-hydrate member gate applies. Omitted in Studio, which bypasses the gate on both sides.

Inherited from

JoyBlockVisibility.eligibility

error?
error?: string;
hidden?
hidden?: boolean;

The SSR verdict — true means render nothing at all.

Inherited from

JoyBlockVisibility.hidden

locale?
locale?: string;

Hydrogen's locale for this request, normalised for Joy. Read server-side from storefront.i18n so the client-side personalised calls render text in the same language as the route the shopper is on.

personalized?
personalized?: boolean;

true when the verdict is personalized to a logged-in customer. Loaders that read this field must set Cache-Control: private, no-store (via JOY_PERSONALIZED_CACHE_CONTROL from @joy-loyalty/hydrogen) when this is true, to prevent an intermediate cache (CDN, Oxygen full-page, or shared layers) from serving a logged-in customer's eligibility to a different visitor. Omitted in Studio.

Inherited from

JoyBlockVisibility.personalized

pointLabel?
pointLabel?: PointLabel | null;

The shop's own singular/plural for its loyalty currency, from the public /shop-config. Null when that call failed — see lib/points.ts for what each branch prints.

shopDomain?
shopDomain?: string;

JOY_SHOP_DOMAIN — threaded into the shared client so getInfo() carries ?d=.


LoyaltyWidgetProps

Extends

Properties

accentColor?
accentColor?: string;
children?
children?: Element[];

Rendered child component instances.

Inherited from

HydrogenComponentProps.children

className?
className?: string;

Optional CSS class passed through by the renderer.

Inherited from

HydrogenComponentProps.className

Component
Component: ForwardRefExoticComponent<any>;

The React component registered for the element.

Inherited from

HydrogenComponentProps.Component

data-wv-id
"data-wv-id": string;

The unique element identifier used in rendered markup.

Inherited from

HydrogenComponentProps.data-wv-id

data-wv-type
"data-wv-type": string;

The element type used in rendered markup.

Inherited from

HydrogenComponentProps.data-wv-type

launcherLabel
launcherLabel: string;
loaderData?
loaderData?: LoyaltyWidgetLoaderData;

Result returned by the component's server-side loader.

Inherited from

HydrogenComponentProps.loaderData

loginLabel
loginLabel: string;
loginUrl
loginUrl: string;
loyaltyPageUrl
loyaltyPageUrl: string;
panelHeading
panelHeading: string;
pointsLabel
pointsLabel: string;
position
position: "bottom-right" | "bottom-left";
type
type: string;

The registered element type.

Inherited from

HydrogenComponentProps.type

viewRewardsLabel
viewRewardsLabel: string;

Variables

schema

const schema: SchemaType;

Functions

default()

function default(props): Element;

Parameters

ParameterType
propsLoyaltyWidgetProps

Returns

Element


loader()

function loader(__namedParameters): Promise<LoyaltyWidgetLoaderData>;

Parameters

ParameterType
__namedParametersComponentLoaderArgs

Returns

Promise<LoyaltyWidgetLoaderData>


LoyaltyWidgetPanel()

function LoyaltyWidgetPanel(__namedParameters): Element;

Pure panel content — deterministic for every lifecycle state.

Parameters

ParameterType
__namedParametersPanelProps

Returns

Element