Fides Documentation – Ethyca

Interface: FidesEvent

FidesJS dispatches a variety of lifecycle events to the global window, making it easy to subscribe to an event stream to keep your application updated in real-time. Each of these events extends the standard CustomEvent interface and includes a detail object with various properties that can be used for inspecting current consent preferences, generating analytics, etc.

Example

window.addEventListener("FidesUpdated", (evt) => {
  console.log("Received 'FidesUpdated' event! Current consent preferences: ", evt.detail.consent);
});

See the list below for information on what events are dispatched (and when!) and the detail reference for the available properties.

List of FidesEvent Types

Properties

detail

detail: object

Event properties passed by FidesJS when dispatched. Depending on the event type, some properties may or may not be set, so most of these are marked as optional.