Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easycookieconsent

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easycookieconsent

Easy Cookie Consent Popup

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This is an easy Javascript for cookie acceptance popup on your website. You can modify text, text-color, urls, popup position and more. After clicking the "Got It" button, the acceptance will be remembered in the browser cookie.

Screen Shot 2565-05-31 at 00.13.58

Example

https://tungdmctv.github.io/easy-cookie-consent/

Setup

<script src="https://unpkg.com/easycookieconsent@1.0.6/cookieAccept.min.js"> </script>

<script>
   const cookieConsent = new CookieAccept({
     domain: "https://yourdomain.com",
     dayExpire: 60,
     url: {
       privacyPolicy: "https://yourdomain.com/privacy",
       cookiePolicy: "https://yourdomain.comv/cookie",
       target: "_blank",
     },
     align: "right",
   });
	cookieConsent.init();
</script>

Configuration

// ALL Config value
const config = {
  domain: "https://yourdomain.com",
  dayExpire: 60,
  text: {
    header: "This website uses cookies",
    body: "We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.",
    privacyPolicy: "PrivacyPolicy",
    learnMore: "Learn More",
    accept: "Got it!",
  },
  bgColor: "#F3F4F6",
  textColor: "#1F2937",
  buttonColor: "#6366F1",
  buttonTextColor: "#FFFFFF",
  buttonBorderColor: "#FFFFFF",
  linkColor: "#2563EB",
  url: {
    privacyPolicy: "https://yourdomain.com/privacy",
    cookiePolicy: "https://yourdomain.comv/cookie",
    target: "_blank",
  },
  align: "right", // left center right
};

const cookieConsent = new CookieAccept(config);
cookieConsent.init();

การตั้งค่าสำหรับภาษาไทย

// ค่า Default ทั้งหมด

const cookieConsent = new CookieAccept({
  domain: "localhost",
  dayExpire: 60,
  text: {
    header: "เว็บไซต์นี้ใช้คุกกี้",
    body: "เราใช้คุกกี้เพื่อวิเคราะห์การเข้าใช้งาน และทำความเข้าใจว่าผู้ใช้งานมาจากที่ใด สามารถเลือกตั้งค่าความยินยอมการใช้คุกกี้ได้ โดย “ตั้งค่าคุกกี้ใน Browser ของคุณ”",
    privacyPolicy: "นโยบายความเป็นส่วนตัว",
    learnMore: "เรียนรู้เพิ่มเติม",
    accept: "ยอมรับ",
  },
  bgColor: "#F3F4F6",
  textColor: "#1F2937",
  buttonColor: "#6366F1",
  buttonTextColor: "#FFFFFF",
  buttonBorderColor: "#FFFFFF",
  linkColor: "#2563EB",
  url: {
    privacyPolicy: "https://video.dmc.tv/privacy",
    cookiePolicy: "https://video.dmc.tv/cookie",
    target: "_blank",
  },
  align: "right",
});
cookieConsent.init();

Screen Shot 2565-05-31 at 00.04.27

Keywords

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc