Cookie consent banner
@slashclone/cookie-consent-banner
Add an honest cookie banner to a web app: analytics, ad pixels, and video embeds load only after a yes, and saying no is one click. One registry of every cookie and service drives the banner, the loaders, the CSP, and the privacy page's cookie table. Includes a registry checker and React templates.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1{
- 2 "consentCookie": "consent",
- 3 "necessary": [
- 4 {
- 5 "name": "session",
- 6 "purpose": "Keeps you signed in.",
- 7 "lifetime": "30 days"
- 8 },
- 9 {
- 10 "name": "oauth_state",
- 11 "purpose": "Protects sign-in from forgery.",
- 12 "lifetime": "10 minutes"
- 13 },
- 14 {
- 15 "name": "consent",
- 16 "purpose": "Remembers your cookie choices.",
- 17 "lifetime": "6 months"
- 18 },
- 19 {
- 20 "name": "theme (browser storage)",
- 21 "purpose": "Remembers light or dark mode, only after you pick one.",
- 22 "lifetime": "Until you clear it"
- 23 }
- 24 ],
- 25 "services": [
- 26 {
- 27 "id": "attribution",
- 28 "name": "Sign-up source",
- 29 "category": "analytics",
- 30 "provider": "This site",
- 31 "stores": [
- 32 {
- 33 "name": "src",
- 34 "purpose": "The site or campaign that first brought you here.",
- 35 "lifetime": "30 days"
- 36 }
- 37 ],
- 38 "clear": "^src$",
- 39 "csp": {}
- 40 },
- 41 {
- 42 "id": "stats",
- 43 "name": "Product analytics",
- 44 "category": "analytics",
- 45 "provider": "An analytics vendor",
- 46 "privacyUrl": "https://stats.example/privacy",
- 47 "stores": [
- 48 {
- 49 "name": "_stats_id",
- 50 "purpose": "A random visitor id.",
- 51 "lifetime": "1 year"
- 52 }
- 53 ],
- 54 "clear": "^_stats_.*$",
- 55 "csp": {
- 56 "script": ["https://cdn.stats.example"],
- 57 "connect": ["https://collect.stats.example"]
- 58 }
- 59 },
- 60 {
- 61 "id": "ads",
- 62 "name": "Ad pixel",
- 63 "category": "advertising",
- 64 "provider": "An ad platform",
- 65 "privacyUrl": "https://ads.example/privacy",
- 66 "stores": [
- 67 {
- 68 "name": "_ad_click",
- 69 "purpose": "Matches a visit to an ad click.",
- 70 "lifetime": "90 days"
- 71 }
- 72 ],
- 73 "clear": "^_ad_.*$",
- 74 "csp": {
- 75 "script": ["https://pixel.ads.example"],
- 76 "img": ["https://pixel.ads.example"]
- 77 }
- 78 },
- 79 {
- 80 "id": "video",
- 81 "name": "Video player",
- 82 "category": "media",
- 83 "provider": "A video host",
- 84 "privacyUrl": "https://video.example/privacy",
- 85 "stores": [
- 86 {
- 87 "name": "Set by the video host",
- 88 "purpose": "Plays the video.",
- 89 "lifetime": "Set by the video host"
- 90 }
- 91 ],
- 92 "csp": {
- 93 "frame": ["https://player.video.example"]
- 94 }
- 95 }
- 96 ]
- 97}
