Skip to content

Documentation / @frak-labs/core-sdk / actions / displaySharingPage

Function: displaySharingPage()

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

Defined in: actions/displaySharingPage.ts:38

Function used to display a sharing page

Parameters

client

FrakClient

The current Frak Client

params

DisplaySharingPageParamsType

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

placement?

string

Optional placement ID to associate with this display request

Returns

Promise<DisplaySharingPageResultType>

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

Remarks

  • 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" }

Example

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"