-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javascript API to subscribe to "events" for preference changes/initialization/etc #3350
Comments
I gave this some thought and poked around at other generic JavaScript projects, and it does seem like there are three good options:
My preference is to do 1&2: trigger window events for vanilla JS installations, but also provide an explicit callback for React projects that import us. I don't think it's worth adding the EventEmitter module or similar; once you go that direction, it feels better to go all the way and support native ESM imports and React props 👍 |
Closed by #3454 |
moving to done |
As a web developer, I want to add the Fides components to my site and have a simple way to subscribe to “events” that are triggered when the consent preferences are either initialized to default values, or updated based on a user’s preferences, so that I can write custom Javascript code to manage tags or enforce consent on my own systems.
Details
We need to provide as much backwards-compatibility as possible with the existing fides.js API, which is a simple read-only window.Fides.consent object that includes the user’s consent preferences
We need to ensure that events are triggered whenever the preferences change, including:
etc.
AC
The text was updated successfully, but these errors were encountered: