Skip to main content
Your creator surface and fan surface talk to Fanvue with window.parent.postMessage, using the messages in the table. Analytics events and host-rendered dialogs travel over a different channel, the host bridge. Fanvue accepts a message only from your iframe at its registered origin, and drops malformed messages silently.

Messages

Every message carries its type as a field. The other fields:
  • token is the opaque request token from POST /experiences/request-token.
  • clientReferenceId is up to 200 characters, and is echoed on the result and on the settled-purchase webhook.
  • amountMinorUnits and priceCents are USD cents.
  • reason is set on a cancelled publish or unpublish result when the ending was not the creator’s choice; the values are on Publish experiences.
  • reviewStatus is set on a published publish result, as pending_review or approved; see Review.
A purchase-request never carries an amount; the price comes from the catalogue. A price-result of saved without amountMinorUnits means the creator withdrew the action.

Rate limits

Each fan message type allows a burst of 3 and 10 requests per minute. A purchase, top-up or consent request over budget answers failed. A close request over budget is ignored.

Origin checks

Validate event.origin on every reply with isFanvueOrigin, which requires the protocol https: and the host fanvue.com or a *.fanvue.com subdomain. Fanvue posts replies only to the origin of your registered surface URL. The check guards against another frame on the same origin.

SDK coverage

The SDK ships isFanvueOrigin, plus schemas and type guards for the four publish and unpublish messages: PublishRequestMessageSchema, PublishResultMessageSchema, UnpublishRequestMessageSchema, UnpublishResultMessageSchema, isPublishResultMessage and isUnpublishResultMessage. Price, purchase, top-up, consent and close have no SDK helpers, so post those by hand.

Listener

One listener can validate the origin and dispatch on type.