Aller au contenu

sendInteraction

Ce contenu n’est pas encore disponible dans votre langue.

sendInteraction(client, params): Promise<void>

Defined in: actions/sendInteraction.ts:43

Send an interaction to the backend via the listener RPC. Fire-and-forget: errors are caught and logged, not thrown.

FrakClient

The Frak client instance

SendInteractionParamsType

The interaction parameters

Promise<void>

Sends a user interaction event through the wallet iframe RPC. Supports three interaction types: arrival tracking, sharing events, and custom interactions.

Track a user arrival with referral attribution:

await sendInteraction(client, {
type: "arrival",
referrerWallet: "0x1234...abcd",
landingUrl: window.location.href,
utmSource: "twitter",
utmMedium: "social",
utmCampaign: "launch-2026",
});

Track a sharing event:

await sendInteraction(client, { type: "sharing" });

Send a custom interaction:

await sendInteraction(client, {
type: "custom",
customType: "newsletter_signup",
data: { email: "user@example.com" },
});