chiiya / haven Goto Github PK
View Code? Open in Web Editor NEW๐ก๏ธ Fully-featured, GDPR-ready cookie consent manager
Home Page: https://chiiya.github.io/haven/
License: MIT License
๐ก๏ธ Fully-featured, GDPR-ready cookie consent manager
Home Page: https://chiiya.github.io/haven/
License: MIT License
Hi,
First of all, a big thank you for creating this package. It's really helpful.
I'd like to know if it would be possible for you to instead of console.warn("Replacing an existing Haven instance. Are you sure this behaviour is intended?");
if you could simply return the existing instance.
create would be like this
public static create(options: Partial<HavenOptions>): Haven {
if (Haven.instance) {
return Haven.instance
} else {
Haven.instance = new Haven(options);
Haven.instance.init();
return Haven.instance;
}
}
If we have already an instance then there's no point in creating a new one right?
In my code I'm doing
const havenInstance = Haven.getInstance()
if (!havenInstance) {
Haven.create(options)
}
But now I'm getting a console error because getInstance()
has this console.error("No Haven instance found. Make sure to create a Haven instance before attempting to access it.")
Thank you
Hi!
If a user enables a cookie type from the preferences panel (if user clicks directly on "settings" instead of accepting or declining all), the notification bar still shows up all the time. Even though the user explicitly chose his preferences.
I think the bar should hide since we can suppose the user has chosen at that point.
I had a look and I think whenever enableCookies
is called, it should set every untouched cookies to their default value (false
in that case).
What do you think?
I love your simple injection implementation. How can I set the anonymizeIp
option, though? Normally I add this to my analytics call:
ga('send', 'pageview', {
'anonymizeIp': true
});
Is it enough to add it to the options array? I tried this but I'm not sure if it's working:
<script>
Haven.create({
services: [
{
name: 'google-analytics',
purposes: ['analytics'],
type: 'google-analytics',
inject: true,
options: {
id: 'BLAH',
anonymizeIp: true,
}
}
]
});
</script>
Hi,
The cookie preference is only instanciated at page load, meaning that if you use the plugin with client side routing (like with React or any other framework) it doesn't work.
The workaround I found is to do the following:
const haven = Haven.getInstance();
if (haven) {
// @ts-ignore
haven.cookiePreferences.init();
}
Of course that's an ugly hack and I think there could be an API for that!
Thanks!
Hi there
Firstly, thanks for creating ๐
Not sure if its a typo but _import Haven from '@chiiya@haven';
didn't work for me, but import Haven from '@chiiya/haven';
did..
Resolved my reactjs issues, Monday mind block :)
The docs mention configuring the notification style, but doesn't give an example. Neither of these seem to work:
<script>
Haven.create({
notification: {
policyUrl: "blah.com",
background: '#428bca',
textColor: '#ffffff',
style: {
background: '#428bca',
textColor: '#ffffff',
},
},
...
});
</script>
Thanks!
Edit: I saw in the cookie preferences docs that we need to use styles
(plural) instead of style
. I tried this for the notification and it works. Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.