files/en-us/web/api/window/fence/index.md
{{SeeCompatTable}}{{APIRef("Fenced Frame API")}}
The fence read-only property of the {{domxref("Window")}} interface returns a {{domxref("Fence")}} object instance for the current document context.
Fence objects are only available to documents embedded inside {{htmlelement("fencedframe")}}s (loaded via {{domxref("FencedFrameConfig")}}s) or {{htmlelement("iframe")}}s (loaded via opaque URNs).
[!NOTE] See How do
<fencedframe>s work? for some description aroundFencedFrameConfigs and opaque URNs.
A {{domxref("Fence")}} object instance, or null if the document context does not have access to a {{domxref("Fence")}} object.
window.fence.reportEvent({
eventType: "click",
eventData: JSON.stringify({ clickX: "123", clickY: "456" }),
destination: ["buyer", "seller"],
});
{{Specifications}}
{{Compat}}