Skip to content

displaySharingPage

displaySharingPage(client, params, placement?): Promise<DisplaySharingPageResultType>

Defined in: actions/displaySharingPage.ts:38

Function used to display a sharing page

FrakClient

The current Frak Client

DisplaySharingPageParamsType

The parameters to customize the sharing page (products, link override, metadata)

string

Optional placement ID to associate with this display request

Promise<DisplaySharingPageResultType>

The result indicating the user’s action (shared, copied, or dismissed)

This function will display a full-page sharing UI to the user, showing product info, estimated rewards, sharing steps, FAQ, and share/copy buttons. The sharing link is generated from the user’s wallet context + merchant info.

  • The promise resolves on the first user action (share or copy) but the page stays visible
  • The user can continue to share/copy multiple times after the initial resolution
  • Dismissing the page after a share/copy action is a no-op (promise already resolved)
  • If the user dismisses without any action, the promise resolves with { action: "dismissed" }
const result = await displaySharingPage(frakClient, {
products: [
{
title: "Babies camel cuir velours bout carré",
imageUrl: "https://example.com/product.jpg",
},
],
});
console.log("User action:", result.action); // "shared" | "copied" | "dismissed"