Skip to content

Commit 0ffeeff

Browse files
committed
Domain Configuration via .env
Domain Configuration via .env: You can now set the domain for Cookiebot directly in your .env file. This update brings more flexibility and control over your Cookiebot implementation by allowing you to configure the domain without needing to modify component props.
1 parent 41f95cd commit 0ffeeff

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ function App() {
4444
## Options
4545
Set in your .env File
4646

47-
| Option | Type | Description | Default |
48-
|--------|----------|-------------------------------|-----------|
49-
| COOKIEBOT_ID | `string` | The ID of your Domain | `""` |
50-
| COOKIEBOT_DEBUG | `string` | Enable the Debug Mode | `"false"` |
51-
47+
| Option | Type | Description | Default |
48+
|--------|----------|------------------------|-----------|
49+
| COOKIEBOT_ID | `string` | The ID of your Domain | `""` |
50+
| COOKIEBOT_DEBUG | `string` | Enable the Debug Mode | `"false"` |
51+
| COOKIEBOT_URL | `string` | The URL from Cookiebot | `"https://consent.cookiebot.com/uc.js"` |
5252
## Roadmap
5353

5454
- More Config Options

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@danielgietmann/react-cookiebot",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"private": false,
55
"description": "The Cookiebot Consent Banner Loader is a streamlined script designed to effortlessly integrate the Cookiebot consent management platform into your website. This lightweight, GDPR-compliant solution ensures that your site adheres to international privacy regulations by managing and documenting visitor consents for cookies and tracking technologies. Easy to implement and operate, the Cookiebot Loader enhances user trust by providing clear options to accept or reject cookies, maintaining a balance between compliance and user experience.",
66
"main": "./dist/index.js",

src/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import React from "react";
22

3-
const CookieBotLoader = ()=>{
3+
const CookieBotLoader = () => {
44

5-
const CookieBotUrl = "https://consent.cookiebot.com/uc.js";
65

76
// @ts-ignore
87
const CookieBotID = process.env.COOKIEBOT_ID
98
//@ts-ignore
109
const CookieBotDebug = process.env.COOKIEBOT_DEBUG || "false"
10+
// @ts-ignore
11+
const CookieBotUrl = process.env.COOKIEBOT_URL || "https://consent.cookiebot.com/uc.js";
12+
1113

12-
if(CookieBotDebug === "true"){
13-
if(CookieBotID === undefined){
14+
if (CookieBotDebug === "true") {
15+
if (CookieBotID === undefined) {
1416
console.warn("CookieBotID is not set")
15-
}
16-
else {
17-
console.log("CookieBotID is set to",CookieBotID)
17+
} else {
18+
console.log("CookieBotID is set to", CookieBotID)
1819
}
1920
}
2021

@@ -34,8 +35,8 @@ const CookieBotLoader = ()=>{
3435
>
3536
</script>
3637
)
37-
}else {
38-
if(CookieBotDebug === "true"){
38+
} else {
39+
if (CookieBotDebug === "true") {
3940
console.log("The Cookie Bar is not Work in Non Production - But is Generally Working");
4041
}
4142
return null;

0 commit comments

Comments
 (0)