consentify-migrate 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -63
- package/dist/index.js +15733 -14517
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# consentify-migrate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Set up [Consentify](https://consentify.app) across your projects in one command. The tool detects your framework, removes whatever consent tool you have today (Cookiebot, OneTrust, CookieYes, Iubenda, Usercentrics, and many more, or nothing at all) along with any tracking scripts, detects your existing integrations, creates your domain on Consentify, wires the script into the right place, and commits the changes to git.
|
|
4
|
+
|
|
5
|
+
It works on a single project, or on a whole folder of client sites at once (bulk mode), which is built for agencies and teams managing many websites.
|
|
4
6
|
|
|
5
7
|
```bash
|
|
8
|
+
# Single project (run from the project root)
|
|
6
9
|
npx consentify-migrate
|
|
10
|
+
|
|
11
|
+
# A whole folder of sites
|
|
12
|
+
npx consentify-migrate bulk ./clients
|
|
7
13
|
```
|
|
8
14
|
|
|
9
15
|
No installation needed.
|
|
@@ -12,97 +18,131 @@ No installation needed.
|
|
|
12
18
|
|
|
13
19
|
## Before you start
|
|
14
20
|
|
|
15
|
-
You need a
|
|
21
|
+
You need a Consentify account. Create one at [consentify.app](https://consentify.app). For bulk runs across many domains, make sure your plan has enough domain capacity.
|
|
16
22
|
|
|
17
23
|
---
|
|
18
24
|
|
|
19
|
-
##
|
|
25
|
+
## Single project mode
|
|
20
26
|
|
|
21
|
-
Run the command from your project root
|
|
27
|
+
Run the command from your project root. It walks you through:
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
1. **Detects your framework** and the exact entry point to use for it.
|
|
30
|
+
2. **Finds your existing consent tool and tracking scripts** in your source and removes them. It recognizes the common CMPs (Cookiebot, OneTrust, CookieYes, CookieFirst, Termly, Osano, Iubenda, Usercentrics, Didomi, TrustArc, Civic, Cookie Script, Klaro, Complianz, Borlabs, Quantcast, Sourcepoint, vanilla Cookie Consent). If the site has no CMP yet, it just sets Consentify up fresh. Trackers get re-injected by Consentify after consent.
|
|
31
|
+
3. **Detects integrations** the same way the dashboard onboarding does: it runs Consentify's live GDPR scanner against your domain and picks up the tools we support (Google Analytics, GTM, Facebook Pixel, PostHog, TikTok, LinkedIn, Snapchat, HubSpot, Contentsquare, Intercom), including ones loaded through GTM. If the site isn't reachable, it falls back to scanning your source code. Paid integrations are only enabled if your plan includes them.
|
|
32
|
+
4. **Finds your privacy policy** by looking for a policy route in the project (`privacy`, `privacy-policy`, `personvern`, `cookies`, and more, across languages), and uses `https://{domain}/{that-path}`.
|
|
33
|
+
5. **Logs you in** to Consentify (credentials are used once and never stored).
|
|
34
|
+
6. **Creates your domain** and configures the detected integrations via the API.
|
|
35
|
+
7. **Injects the Consentify script** at the correct location for your framework.
|
|
36
|
+
8. **Commits the change** to git (see git modes below).
|
|
25
37
|
|
|
26
|
-
|
|
27
|
-
Scans all source files and reports exactly where Cookiebot references live.
|
|
38
|
+
Use `--no-scan` to skip the live scanner and rely on source-code detection only.
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
Automatically finds Google Analytics, Google Tag Manager, Facebook Pixel, PostHog, TikTok Pixel, LinkedIn Insight Tag, Snapchat Pixel, HubSpot, Contentsquare, and Intercom — and extracts their IDs directly from your code.
|
|
40
|
+
---
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
You enter your email and password once. Your credentials are used only to authenticate and are never stored.
|
|
42
|
+
## Bulk mode
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
Picks the right team, creates the domain, and configures your detected integrations automatically via the Consentify API.
|
|
44
|
+
Point the tool at a folder whose immediate subfolders are individual sites:
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
```bash
|
|
47
|
+
npx consentify-migrate bulk ./clients
|
|
48
|
+
```
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
```
|
|
51
|
+
clients/
|
|
52
|
+
acme.com/ → Next.js (App Router)
|
|
53
|
+
bergen-cafe/ → WordPress
|
|
54
|
+
nordic-shop.no/ → Vue
|
|
55
|
+
...
|
|
56
|
+
```
|
|
42
57
|
|
|
43
|
-
|
|
58
|
+
For each project it detects the framework, resolves the domain, scans for integrations, sets up Consentify, strips trackers, injects the script, and commits + pushes on a dedicated branch. Failures on one project never stop the rest of the batch. At the end you get a `consentify-migration-report.md` (and `.json`) in the folder with every domain, token, and anything that needs manual follow-up.
|
|
44
59
|
|
|
45
|
-
|
|
60
|
+
Before it starts, the run checks your plan's domain capacity. If the folder has more sites than you have room for, it tells you up front and (with your confirmation) sets up as many as fit, rather than failing partway through. The rest are listed in the report as skipped for capacity.
|
|
46
61
|
|
|
47
|
-
|
|
48
|
-
🍪 Consentify Migration Tool
|
|
49
|
-
──────────────────────────────────────────────────
|
|
62
|
+
### Resolving domains
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
Each site needs a domain. The tool resolves it in this order:
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
1. **Manifest file** (recommended for large batches), matched by folder name.
|
|
67
|
+
2. **Folder name**, if the folder is itself a domain (e.g. `acme.com`).
|
|
68
|
+
3. **Git remote**, if the repo name is a domain.
|
|
69
|
+
4. **Prompt**, for anything still unresolved (unless `--yes`).
|
|
55
70
|
|
|
56
|
-
|
|
57
|
-
• Google Analytics (G-ABC1234DEF)
|
|
58
|
-
• Google Tag Manager (GTM-XXXXXX)
|
|
71
|
+
Manifest as CSV:
|
|
59
72
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
```csv
|
|
74
|
+
folder,domain,policyUrl
|
|
75
|
+
acme-site,acme.com,https://acme.com/privacy
|
|
76
|
+
bergen-cafe,bergen-cafe.no,
|
|
77
|
+
```
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
✓ Using team: Acme Corp
|
|
79
|
+
or JSON:
|
|
68
80
|
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
```json
|
|
82
|
+
{ "acme-site": "acme.com", "bergen-cafe": "bergen-cafe.no" }
|
|
83
|
+
```
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npx consentify-migrate bulk ./clients --manifest ./domains.csv --yes
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Git modes
|
|
75
92
|
|
|
76
|
-
|
|
93
|
+
By default every project is committed on a dedicated `consentify-setup` branch and pushed, so nothing lands on `main` without review. Only the files the tool changed are staged, so any pre-existing uncommitted work is left alone.
|
|
77
94
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
| Flag | Behavior |
|
|
96
|
+
| ---------------- | --------------------------------------------------------------- |
|
|
97
|
+
| `--git=branch` | Create `consentify-setup` branch, commit, push (default). |
|
|
98
|
+
| `--git=push` | Commit on the current branch and push. |
|
|
99
|
+
| `--git=commit` | Commit only, no push. |
|
|
100
|
+
| `--git=none` | Make file changes only, no git. |
|
|
83
101
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
✓ app/layout.tsx | Removed Cookiebot, added Consentify <Script>
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Options
|
|
88
105
|
|
|
89
|
-
|
|
106
|
+
| Flag | Description |
|
|
107
|
+
| --------------------------- | ---------------------------------------------------------------- |
|
|
108
|
+
| `bulk [dir]` / `--all` | Bulk mode over a folder of projects (default dir: cwd). |
|
|
109
|
+
| `--manifest <file>` | CSV or JSON folder to domain mapping. |
|
|
110
|
+
| `--policy-pattern "<p>"` | Fallback privacy policy URL if none detected, `{domain}` substituted. |
|
|
111
|
+
| `--git=<mode>` | Git behavior (see above). |
|
|
112
|
+
| `--no-scan` | Skip the live scanner; detect integrations from source only. |
|
|
113
|
+
| `--dry-run` | Detect and report only. No API calls, file writes, or git. |
|
|
114
|
+
| `--yes` / `-y` | Skip confirmation prompts (requires resolvable domains). |
|
|
90
115
|
|
|
91
|
-
|
|
116
|
+
Example, non-interactive agency run:
|
|
92
117
|
|
|
93
|
-
|
|
118
|
+
```bash
|
|
119
|
+
npx consentify-migrate bulk ./clients \
|
|
120
|
+
--manifest ./domains.csv \
|
|
121
|
+
--policy-pattern "https://{domain}/personvern" \
|
|
122
|
+
--git=branch --yes
|
|
94
123
|
```
|
|
95
124
|
|
|
96
125
|
---
|
|
97
126
|
|
|
98
127
|
## Supported frameworks
|
|
99
128
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
129
|
+
Each framework gets the script placed where it actually belongs, not just anywhere.
|
|
130
|
+
|
|
131
|
+
| Framework | Where the script goes |
|
|
132
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
133
|
+
| Next.js (App Router) | Root layout `<body>` via `next/script` |
|
|
134
|
+
| Next.js (Pages Router) | `pages/_document` (created if missing) |
|
|
135
|
+
| React (CRA / Vite) | `index.html` before `</body>` |
|
|
136
|
+
| Vue | `index.html` before `</head>` |
|
|
137
|
+
| Nuxt | Generated client plugin using `useHead` |
|
|
138
|
+
| SvelteKit | `src/app.html` |
|
|
139
|
+
| Svelte (Vite) | `index.html` |
|
|
140
|
+
| Astro | Base layout `<head>` |
|
|
141
|
+
| Angular | `src/index.html` |
|
|
142
|
+
| WordPress | Theme `header.php` before `wp_head()` |
|
|
143
|
+
| Vanilla HTML | `index.html` before `</body>` |
|
|
144
|
+
|
|
145
|
+
Re-running is safe: if Consentify is already present in a project, it is skipped.
|
|
106
146
|
|
|
107
147
|
---
|
|
108
148
|
|
|
@@ -110,19 +150,20 @@ Your Consentify script tag:
|
|
|
110
150
|
|
|
111
151
|
Google Analytics, Google Tag Manager, Facebook Pixel, PostHog, TikTok Pixel, LinkedIn Insight Tag, Snapchat Pixel, HubSpot, Contentsquare, Intercom.
|
|
112
152
|
|
|
113
|
-
Integrations that are detected but whose ID could not be extracted
|
|
153
|
+
Integrations that are detected but whose ID could not be extracted are flagged in the report to configure manually in the dashboard.
|
|
114
154
|
|
|
115
155
|
---
|
|
116
156
|
|
|
117
157
|
## After the migration
|
|
118
158
|
|
|
119
|
-
- Review the file changes
|
|
120
|
-
- Customize your
|
|
121
|
-
- Deploy
|
|
159
|
+
- Review the branch and file changes before merging.
|
|
160
|
+
- Customize your banners at [consentify.app/dashboard/banner](https://consentify.app/dashboard/banner).
|
|
161
|
+
- Deploy and Consentify is live.
|
|
122
162
|
|
|
123
163
|
---
|
|
124
164
|
|
|
125
165
|
## Requirements
|
|
126
166
|
|
|
127
167
|
- Node.js 18 or later
|
|
168
|
+
- Git (for commit/push modes)
|
|
128
169
|
- A [Consentify account](https://consentify.app)
|