Skip to content
SlashClone

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.

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

Cookies that keep you signed in and remember these choices are always on. Everything else is off until you turn it on.