Skip to content

ButtonShareProps

ButtonShareProps = { classname?: string; clickAction?: "sharing-page" | string & { }; noRewardText?: string; placement?: string; preview?: string; products?: SharingPageProduct[] | string; targetInteraction?: InteractionTypeKey; text?: string; }

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:10

The props type for ButtonShare.

optional classname?: string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:29

Classname to apply to the button


optional clickAction?: "sharing-page" | string & { }

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:59

Reported on the share_button_clicked event.

It no longer selects anything: every click opens the full-page sharing UI. Retired values ("share-modal", "embedded-wallet") stay accepted because merchant configs and saved plugin markup still carry them, and the resolved value is reported as-is so a legacy config stays visible in analytics.

"sharing-page"


optional noRewardText?: string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:34

Fallback text when text contains the {REWARD} placeholder but no reward is available.


optional placement?: string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:11


optional preview?: string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:66

When set, renders the button in preview mode (e.g. Shopify/WP editor). Skips the client-ready gating so the button is always enabled visually, and no-ops the click handler so merchants can see the final layout with their configured copy even when no Frak client is initialized.


optional products?: SharingPageProduct[] | string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:47

Products currently in view, used to prefer a campaign whose productScope matches one of them when picking the reward to advertise, and forwarded to the sharing page so it can render product cards.

Accepts a SharingPageProduct array (JS property) or a JSON-stringified array (HTML attribute).


optional targetInteraction?: InteractionTypeKey

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:38

Target interaction behind this sharing action (will be used to get the right reward to display)


optional text?: string

Defined in: vendor/wallet/sdk/components/src/components/ButtonShare/types.ts:25

Text to display on the button.

Including the placeholder {REWARD} (e.g. Share and earn up to \{REWARD\}!) opts the button into the live reward flow: the SDK fetches the estimated reward and substitutes the placeholder. When no reward is available, noRewardText is used as a fallback (or the placeholder is stripped if no fallback is provided).

When omitted, a built-in localized default is used based on the resolved language ("Share & earn {REWARD}!" / "Partagez et gagnez {REWARD} !") — mirroring the dashboard’s first wording preset.