c15t 1.5.0 → 1.6.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/CHANGELOG.md +5 -322
- package/README.md +101 -39
- package/dist/client/client-c15t.d.ts +1 -20
- package/dist/client/client-c15t.d.ts.map +1 -1
- package/dist/client/client-custom.d.ts +1 -20
- package/dist/client/client-custom.d.ts.map +1 -1
- package/dist/client/client-factory.d.ts +2 -10
- package/dist/client/client-factory.d.ts.map +1 -1
- package/dist/client/client-interface.d.ts +0 -38
- package/dist/client/client-interface.d.ts.map +1 -1
- package/dist/client/client-offline.d.ts +5 -29
- package/dist/client/client-offline.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/index.cjs +392 -485
- package/dist/index.d.ts +42 -81
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +388 -481
- package/dist/libs/consent-utils.d.ts +6 -0
- package/dist/libs/consent-utils.d.ts.map +1 -1
- package/dist/libs/fetch-consent-banner.d.ts.map +1 -1
- package/dist/libs/has.d.ts +100 -0
- package/dist/libs/has.d.ts.map +1 -0
- package/dist/libs/save-consents.d.ts +14 -0
- package/dist/libs/save-consents.d.ts.map +1 -0
- package/dist/store.d.ts +8 -3
- package/dist/store.d.ts.map +1 -1
- package/dist/store.initial-state.d.ts +2 -4
- package/dist/store.initial-state.d.ts.map +1 -1
- package/dist/store.type.d.ts +57 -35
- package/dist/store.type.d.ts.map +1 -1
- package/dist/types/callbacks.d.ts +29 -134
- package/dist/types/callbacks.d.ts.map +1 -1
- package/dist/types/compliance.d.ts +6 -0
- package/dist/types/compliance.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -41
- package/dist/types/index.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +34 -17
- package/readme.json +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,330 +1,13 @@
|
|
|
1
1
|
# c15t
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.6.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 84ab0c7: For a full detailed changelog see the [v1.6.0 release notes](https://c15t.com/changelog/2025-09-08-v1.6.0).
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
- Updated dependencies [
|
|
12
|
-
-
|
|
13
|
-
- @c15t/
|
|
14
|
-
- @c15t/translations@1.5.0
|
|
15
|
-
|
|
16
|
-
## 1.5.0-canary-20250722133547
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- 35b5fc3: fix: removed package.json imports for Next 13 compatibility
|
|
21
|
-
- Updated dependencies [35b5fc3]
|
|
22
|
-
- @c15t/backend@1.5.0-canary-20250722133547
|
|
23
|
-
|
|
24
|
-
## 1.5.0-canary-20250722085128
|
|
25
|
-
|
|
26
|
-
### Minor Changes
|
|
27
|
-
|
|
28
|
-
- 35f052c: feat(nextjs): added pages support
|
|
29
|
-
|
|
30
|
-
### Patch Changes
|
|
31
|
-
|
|
32
|
-
- Updated dependencies [74e1825]
|
|
33
|
-
- @c15t/backend@1.5.0-canary-20250722085128
|
|
34
|
-
|
|
35
|
-
## 1.4.4
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- f6a3e5f: fix(core, react): translation overrides sometimes not set before banner is shown
|
|
40
|
-
|
|
41
|
-
## 1.4.2
|
|
42
|
-
|
|
43
|
-
### Patch Changes
|
|
44
|
-
|
|
45
|
-
- 53774ce: fix(core): hasConsentFor should return true when no consent is needed
|
|
46
|
-
- Updated dependencies [53774ce]
|
|
47
|
-
- @c15t/translations@1.4.2
|
|
48
|
-
- @c15t/backend@1.4.2
|
|
49
|
-
|
|
50
|
-
## 1.4.2-canary-20250702103734
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
- eed347c: fix(core): hasConsentFor should return true when no consent is needed
|
|
55
|
-
- Updated dependencies [cd218e7]
|
|
56
|
-
- @c15t/translations@1.4.2-canary-20250702103734
|
|
57
|
-
- @c15t/backend@1.4.2-canary-20250702103734
|
|
58
|
-
|
|
59
|
-
## 1.4.1
|
|
60
|
-
|
|
61
|
-
### Patch Changes
|
|
62
|
-
|
|
63
|
-
- Updated dependencies [8afd304]
|
|
64
|
-
- @c15t/backend@1.4.1
|
|
65
|
-
|
|
66
|
-
## 1.4.0
|
|
67
|
-
|
|
68
|
-
### Minor Changes
|
|
69
|
-
|
|
70
|
-
- 6eb9a8d: feat(core, react): added ignoreGeoLocation, improved provider props
|
|
71
|
-
feat(core): added 'config' prop to store for better debugging
|
|
72
|
-
fix(react): add aria label to cookie banner component
|
|
73
|
-
fix(cli): removed env import
|
|
74
|
-
fix(cli): asks for pkg manager twice
|
|
75
|
-
|
|
76
|
-
## 1.3.3
|
|
77
|
-
|
|
78
|
-
### Patch Changes
|
|
79
|
-
|
|
80
|
-
- b4d53be: feat(core): added Google Tag Manager support
|
|
81
|
-
fix(react): allow trapFocus={false} in CookieBanner
|
|
82
|
-
fix(nextjs): improved url validation
|
|
83
|
-
|
|
84
|
-
## 1.3.3-canary-20250624131627
|
|
85
|
-
|
|
86
|
-
### Patch Changes
|
|
87
|
-
|
|
88
|
-
- 63200df: feat(core): added Google Tag Manager support
|
|
89
|
-
|
|
90
|
-
## 1.3.1
|
|
91
|
-
|
|
92
|
-
### Patch Changes
|
|
93
|
-
|
|
94
|
-
- 7fecb81: refactor(nextjs): fetch inital data from backend in c15t mode instead of duplicate logic
|
|
95
|
-
fix: incorrect link to quickstart
|
|
96
|
-
fix(issue-274): include nextjs externals in rslib
|
|
97
|
-
fix(core): fall back to API call if initialData promise is empty
|
|
98
|
-
chore: add translation for zh
|
|
99
|
-
- Updated dependencies [7fecb81]
|
|
100
|
-
- @c15t/translations@1.3.1
|
|
101
|
-
- @c15t/backend@1.3.1
|
|
102
|
-
|
|
103
|
-
## 1.3.1-canary-20250618084038
|
|
104
|
-
|
|
105
|
-
### Patch Changes
|
|
106
|
-
|
|
107
|
-
- 95edb35: fix(core): fall back to API call if initialData promise is empty
|
|
108
|
-
- Updated dependencies [5da2f28]
|
|
109
|
-
- @c15t/translations@1.3.1-canary-20250618084038
|
|
110
|
-
- @c15t/backend@1.3.1-canary-20250618084038
|
|
111
|
-
|
|
112
|
-
## 1.3.0
|
|
113
|
-
|
|
114
|
-
### Minor Changes
|
|
115
|
-
|
|
116
|
-
- 85e5e3d: ## 🌍 New Translations Package
|
|
117
|
-
|
|
118
|
-
- **NEW**: Added `@c15t/translations` package with comprehensive i18n support
|
|
119
|
-
- Added translations for 8 languages: English, German, Spanish, Finnish, French, Italian, Dutch, Portuguese
|
|
120
|
-
- Includes translations for consent banners, dialogs, and common phrases
|
|
121
|
-
- Replaced the former `@c15t/middleware` package functionality
|
|
122
|
-
|
|
123
|
-
## 🔧 CLI Enhancements
|
|
124
|
-
|
|
125
|
-
- **NEW**: Added telemetry system with framework and package manager detection
|
|
126
|
-
- **NEW**: Enhanced onboarding flow with better framework detection (React, Next.js, etc.)
|
|
127
|
-
- **NEW**: Automatic package manager detection (pnpm, yarn, npm)
|
|
128
|
-
- **NEW**: Added `--telemetry-debug` flag for debugging telemetry
|
|
129
|
-
- Improved error handling and user experience during setup
|
|
130
|
-
- Better file generation for different storage modes and configurations
|
|
131
|
-
|
|
132
|
-
## 🎯 Backend Updates
|
|
133
|
-
|
|
134
|
-
- **NEW**: Server-side translation support in consent banner handling
|
|
135
|
-
- Added language detection from `Accept-Language` headers
|
|
136
|
-
- Updated consent banner contracts to include translation schemas
|
|
137
|
-
- Enhanced jurisdiction checking with better default handling
|
|
138
|
-
- Updated user agent and IP address handling (now defaults to null instead of "unknown")
|
|
139
|
-
|
|
140
|
-
## ⚛️ React Package Changes
|
|
141
|
-
|
|
142
|
-
- **NEW**: Integrated translation support throughout components
|
|
143
|
-
- Updated `ConsentManagerProvider` to handle initial translation configuration
|
|
144
|
-
- Removed dependency on middleware package
|
|
145
|
-
- Enhanced consent manager store with translation capabilities
|
|
146
|
-
|
|
147
|
-
## 🔄 Next.js Package Restructuring
|
|
148
|
-
|
|
149
|
-
- **BREAKING**: Removed middleware exports and functionality
|
|
150
|
-
- **NEW**: Added `ConsentManagerProvider` component for server-side rendering
|
|
151
|
-
- **NEW**: Server-side consent banner detection with jurisdiction mapping
|
|
152
|
-
- Added support for extracting consent-relevant headers
|
|
153
|
-
- Updated to work with new translations system
|
|
154
|
-
|
|
155
|
-
## 🏗️ Core Package Updates
|
|
156
|
-
|
|
157
|
-
- **NEW**: Integrated translation configuration system
|
|
158
|
-
- Updated offline client to include default translations
|
|
159
|
-
- Enhanced consent banner fetching with translation support
|
|
160
|
-
- Improved store management with initial data handling
|
|
161
|
-
|
|
162
|
-
## 🔄 Infrastructure & Tooling
|
|
163
|
-
|
|
164
|
-
- **NEW**: Added GitHub Actions workflow for canary releases
|
|
165
|
-
- **NEW**: Added branch synchronization workflow (main → canary)
|
|
166
|
-
- Updated BiomeJS configuration with comprehensive linting rules
|
|
167
|
-
- Enhanced build configurations across packages
|
|
168
|
-
|
|
169
|
-
## 📦 Package Management
|
|
170
|
-
|
|
171
|
-
- Updated dependencies across all packages
|
|
172
|
-
- Added peer dependencies where appropriate
|
|
173
|
-
- Improved module exports and build configurations
|
|
174
|
-
- Enhanced TypeScript configurations for better type safety
|
|
175
|
-
|
|
176
|
-
***
|
|
177
|
-
|
|
178
|
-
## 📋 Detailed Change Breakdown
|
|
179
|
-
|
|
180
|
-
### **New Features**
|
|
181
|
-
|
|
182
|
-
- Added multi-language support for consent banners with new translations in German, Spanish, Finnish, French, Italian, Dutch, and Portuguese.
|
|
183
|
-
- Consent banner logic enhanced to detect user location and language from HTTP headers, showing localized messages per jurisdiction.
|
|
184
|
-
- Next.js ConsentManagerProvider now performs server-side initialization of consent state for consistent banner display and translation.
|
|
185
|
-
- CLI onboarding improved with robust environment detection, modularized flow, enhanced telemetry, and guided dependency installation.
|
|
186
|
-
- Introduced new CLI global flag for telemetry debug mode.
|
|
187
|
-
|
|
188
|
-
### **Improvements**
|
|
189
|
-
|
|
190
|
-
- Consent banner responses now include detailed translation structures and jurisdiction information.
|
|
191
|
-
- Translation utilities and types centralized in a new `@c15t/translations` package for easier integration.
|
|
192
|
-
- Onboarding file generation refactored to unify client config and environment file creation.
|
|
193
|
-
- Documentation and changelogs updated for new canary releases and integration guidance.
|
|
194
|
-
- CLI telemetry enhanced with asynchronous event tracking and debug logging support.
|
|
195
|
-
|
|
196
|
-
### **Bug Fixes**
|
|
197
|
-
|
|
198
|
-
- Fixed consent banner logic for correct handling of US jurisdiction and fallback scenarios.
|
|
199
|
-
- Improved error handling and debug logging in CLI telemetry and onboarding.
|
|
200
|
-
|
|
201
|
-
### **Refactor**
|
|
202
|
-
|
|
203
|
-
- Removed legacy middleware exports and Node SDK re-exports from Next.js and middleware packages.
|
|
204
|
-
- Consolidated jurisdiction and consent banner logic into dedicated Next.js consent-manager-provider modules.
|
|
205
|
-
- Updated CLI context creation to async with enriched environment metadata and improved logging.
|
|
206
|
-
- Refactored onboarding storage modes to delegate file generation and unify cancellation handling.
|
|
207
|
-
|
|
208
|
-
### **Tests**
|
|
209
|
-
|
|
210
|
-
- Added extensive tests for consent banner display logic, jurisdiction detection, language preference parsing, and translation selection.
|
|
211
|
-
- Removed deprecated tests for deleted middleware and jurisdiction modules.
|
|
212
|
-
|
|
213
|
-
### **Chores**
|
|
214
|
-
|
|
215
|
-
- Updated package versions and dependencies to latest canary releases, including addition of `@c15t/translations`.
|
|
216
|
-
- Added and updated GitHub Actions workflows for canary releases and branch synchronization.
|
|
217
|
-
- Updated package metadata and configuration files for consistency and improved build settings.
|
|
218
|
-
|
|
219
|
-
This release represents a major step forward in internationalization support, developer experience improvements, and architectural refinements across the entire c15t ecosystem.
|
|
220
|
-
|
|
221
|
-
### Patch Changes
|
|
222
|
-
|
|
223
|
-
- Updated dependencies [85e5e3d]
|
|
224
|
-
- @c15t/backend@1.3.0
|
|
225
|
-
- @c15t/translations@1.3.0
|
|
226
|
-
|
|
227
|
-
## 1.2.2-canary-20250603153501
|
|
228
|
-
|
|
229
|
-
### Patch Changes
|
|
230
|
-
|
|
231
|
-
- e50e925: refactor(core, nextjs): removed use of cookies
|
|
232
|
-
fix(nextjs): pass through promise instead of blocking the app
|
|
233
|
-
feat(react, core): added ability to use server-side translations from show-consent-banner endpoint
|
|
234
|
-
|
|
235
|
-
## 1.2.2-canary-20250602152741
|
|
236
|
-
|
|
237
|
-
### Patch Changes
|
|
238
|
-
|
|
239
|
-
- Updated dependencies [131a2ff]
|
|
240
|
-
- @c15t/backend@1.2.2-canary-20250602152741
|
|
241
|
-
|
|
242
|
-
## 1.2.2-canary-20250521133509
|
|
243
|
-
|
|
244
|
-
### Patch Changes
|
|
245
|
-
|
|
246
|
-
- Updated dependencies [e4b9778]
|
|
247
|
-
- @c15t/backend@1.2.2-canary-20250521133509
|
|
248
|
-
|
|
249
|
-
## 1.2.2-canary-20250514203718
|
|
250
|
-
|
|
251
|
-
### Patch Changes
|
|
252
|
-
|
|
253
|
-
- f24f11b: bump package
|
|
254
|
-
- Updated dependencies [f24f11b]
|
|
255
|
-
- @c15t/backend@1.2.2-canary-20250514203718
|
|
256
|
-
- @c15t/translations@1.2.2-canary-20250514203718
|
|
257
|
-
|
|
258
|
-
## 1.2.2-canary-20250514183211
|
|
259
|
-
|
|
260
|
-
### Patch Changes
|
|
261
|
-
|
|
262
|
-
- f64f000: feat: added @c15t/nextjs, @c15t/translations for better integration, server-side translations & fetching of consent banner
|
|
263
|
-
- Updated dependencies [f64f000]
|
|
264
|
-
- @c15t/translations@1.2.2-canary-20250514183211
|
|
265
|
-
- @c15t/backend@1.2.2-canary-20250514183211
|
|
266
|
-
|
|
267
|
-
## 1.2.1
|
|
268
|
-
|
|
269
|
-
### Patch Changes
|
|
270
|
-
|
|
271
|
-
- Updated dependencies [[`aca32d3`](https://github.com/c15t/c15t/commit/aca32d3f0f76d75ad618a8ba3386ce385ac612e4)]:
|
|
272
|
-
- @c15t/backend@1.2.1
|
|
273
|
-
|
|
274
|
-
## 1.2.0
|
|
275
|
-
|
|
276
|
-
### Minor Changes
|
|
277
|
-
|
|
278
|
-
- [#224](https://github.com/c15t/c15t/pull/224) [`838a9b5`](https://github.com/c15t/c15t/commit/838a9b52c31326899ec3c903e43bf7bc31a6490f) Thanks [@BurnedChris](https://github.com/BurnedChris)! - Refactored backend to be a new orpc client / server
|
|
279
|
-
|
|
280
|
-
### Patch Changes
|
|
281
|
-
|
|
282
|
-
- [#222](https://github.com/c15t/c15t/pull/222) [`b1de2ba`](https://github.com/c15t/c15t/commit/b1de2baccd63295d49fb2868f63659f5ff48a9ce) Thanks [@KayleeWilliams](https://github.com/KayleeWilliams)! - fix(core, react): added "common" translations, removed widget translations
|
|
283
|
-
|
|
284
|
-
- Updated dependencies [[`838a9b5`](https://github.com/c15t/c15t/commit/838a9b52c31326899ec3c903e43bf7bc31a6490f)]:
|
|
285
|
-
- @c15t/backend@1.2.0
|
|
286
|
-
|
|
287
|
-
## 1.1.4
|
|
288
|
-
|
|
289
|
-
### Patch Changes
|
|
290
|
-
|
|
291
|
-
- [#207](https://github.com/c15t/c15t/pull/207) [`2d81c9f`](https://github.com/c15t/c15t/commit/2d81c9fc84ee960e46196dfd460407a925901a82) Thanks [@KayleeWilliams](https://github.com/KayleeWilliams)! - fix(core, react): translations not working
|
|
292
|
-
|
|
293
|
-
## 1.1.3
|
|
294
|
-
|
|
295
|
-
### Patch Changes
|
|
296
|
-
|
|
297
|
-
- [#203](https://github.com/c15t/c15t/pull/203) [`4d47e21`](https://github.com/c15t/c15t/commit/4d47e2109bfc894f1666b19f4ff40d7398f10c57) Thanks [@KayleeWilliams](https://github.com/KayleeWilliams)! - fix(core): callbacks not working on c15t mode
|
|
298
|
-
|
|
299
|
-
## 1.0.1
|
|
300
|
-
|
|
301
|
-
### Patch Changes
|
|
302
|
-
|
|
303
|
-
- [`08446ae`](https://github.com/c15t/c15t/commit/08446aef443a20a2262477a1dca3569d6bf672ad) Thanks [@BurnedChris](https://github.com/BurnedChris)! - # Removal of localstorage option in offline and custom
|
|
304
|
-
|
|
305
|
-
- **Documentation**
|
|
306
|
-
- Updated offline mode documentation to remove references to the `localStorageKey` configuration option.
|
|
307
|
-
- **Bug Fixes**
|
|
308
|
-
- Removed the ability to customize the localStorage key for storing consent data; a fixed key is now always used.
|
|
309
|
-
- **Refactor**
|
|
310
|
-
- Streamlined internal handling of localStorage keys by removing related configuration options and parameters.
|
|
311
|
-
- **Tests**
|
|
312
|
-
- Updated and removed tests related to custom localStorage key usage.
|
|
313
|
-
|
|
314
|
-
## 1.0.0-rc.1
|
|
315
|
-
|
|
316
|
-
### Patch Changes
|
|
317
|
-
|
|
318
|
-
- Refactored package.json imports
|
|
319
|
-
|
|
320
|
-
## 0.0.1-beta.10
|
|
321
|
-
|
|
322
|
-
### Patch Changes
|
|
323
|
-
|
|
324
|
-
- all build tools now use rslib + new formatting from biomejs
|
|
325
|
-
|
|
326
|
-
## 0.0.1-beta.9
|
|
327
|
-
|
|
328
|
-
### Patch Changes
|
|
329
|
-
|
|
330
|
-
- 1912aa9: Refactored codebase to use Ultracite Biome Config for stricter linting
|
|
11
|
+
- Updated dependencies [84ab0c7]
|
|
12
|
+
- @c15t/backend@1.6.0
|
|
13
|
+
- @c15t/translations@1.6.0
|
package/README.md
CHANGED
|
@@ -1,61 +1,123 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://c15t.com?utm_source=github&utm_medium=repopage_c15t" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="../../docs/assets/c15t-banner-readme-dark.svg" type="image/svg+xml">
|
|
5
|
+
<img src="../../docs/assets/c15t-banner-readme-light.svg" alt="c15t Banner" type="image/svg+xml">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<br />
|
|
9
|
+
<h1 align="center">c15t: Developer-First Consent Management Platform</h1>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
[](https://github.com/c15t/c15t)
|
|
13
|
+
[](https://github.com/c15t/c15t/actions/workflows/ci.yml)
|
|
14
|
+
[](https://github.com/c15t/c15t/blob/main/LICENSE.md)
|
|
15
|
+
[](https://c15t.com/discord)
|
|
16
|
+
[](https://www.npmjs.com/package/c15t)
|
|
17
|
+
[](https://github.com/c15t/c15t)
|
|
18
|
+
[](https://github.com/c15t/c15t/commits/main)
|
|
19
|
+
[](https://github.com/c15t/c15t/issues)
|
|
20
|
+
|
|
21
|
+
Developer-first CMP for JavaScript: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization
|
|
22
|
+
|
|
23
|
+
## Key Features
|
|
24
|
+
|
|
25
|
+
- Developer-First Design: Easy integration with minimal configuration
|
|
26
|
+
- Framework Agnostic: Works across JavaScript frameworks
|
|
27
|
+
- GDPR Compliance: Built-in support for privacy regulations
|
|
28
|
+
- Customizable Consent Management: Flexible consent preferences
|
|
29
|
+
- Server-Side Rendering Support: Compatible with SSR frameworks
|
|
30
|
+
- Internationalization: Built-in translation support
|
|
31
|
+
|
|
32
|
+
## Prerequisites
|
|
33
|
+
|
|
34
|
+
- JavaScript or TypeScript project
|
|
35
|
+
- Node.js 18.17.0 or later
|
|
36
|
+
- npm, pnpm, or yarn package manager
|
|
37
|
+
- A hosted [c15t instance](https://consent.io) (free sign-up) or [self-hosted deployment](https://c15t.com/docs/self-host/v2)
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
Easiest setup with @c15t/cli:
|
|
5
42
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
43
|
+
```bash
|
|
44
|
+
# Generate schema and code
|
|
45
|
+
pnpm dlx @c15t/cli generate
|
|
46
|
+
# Alternatives:
|
|
47
|
+
# npx @c15t/cli generate
|
|
48
|
+
# bunx --bun @c15t/cli generate
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The CLI will:
|
|
11
52
|
|
|
12
|
-
|
|
53
|
+
- Install necessary packages
|
|
54
|
+
- Configure your c15t instance
|
|
55
|
+
- Set up environment variables
|
|
56
|
+
- Add consent management components to your app
|
|
57
|
+
|
|
58
|
+
## Manual Installation
|
|
13
59
|
|
|
14
60
|
```bash
|
|
15
|
-
|
|
16
|
-
# or
|
|
17
|
-
yarn add c15t
|
|
18
|
-
# or
|
|
19
|
-
pnpm add c15t
|
|
61
|
+
pnpm add @c15t/core
|
|
20
62
|
```
|
|
21
63
|
|
|
22
|
-
|
|
64
|
+
To manually install, follow the guide in our [docs – manual setup](https://c15t.com/docs/frameworks/javascript/quickstart#manual-setup).
|
|
23
65
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
1. Import the c15t core library
|
|
69
|
+
2. Configure your consent preferences
|
|
70
|
+
3. Manage user consent across your application
|
|
71
|
+
4. Customize consent banners and preference centers
|
|
72
|
+
5. For full implementation details, see the [JavaScript quickstart docs](https://c15t.com/docs/frameworks/javascript/quickstart)
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// Example usage
|
|
76
|
+
import { ConsentManager } from '@c15t/core'
|
|
77
|
+
|
|
78
|
+
const consentManager = new ConsentManager({
|
|
79
|
+
// Your configuration
|
|
80
|
+
})
|
|
30
81
|
```
|
|
31
82
|
|
|
32
83
|
## Documentation
|
|
33
84
|
|
|
34
|
-
For
|
|
85
|
+
For further information, guides, and examples visit the [reference documentation](https://c15t.com/docs/frameworks/javascript/quickstart).
|
|
35
86
|
|
|
36
|
-
##
|
|
87
|
+
## Support
|
|
37
88
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
89
|
+
- Join our [Discord community](https://c15t.com/discord)
|
|
90
|
+
- Open an issue on our [GitHub repository](https://github.com/c15t/c15t/issues)
|
|
91
|
+
- Visit [consent.io](https://consent.io) and use the chat widget
|
|
92
|
+
- Contact our support team via email [support@consent.io](mailto:support@consent.io)
|
|
42
93
|
|
|
43
|
-
##
|
|
94
|
+
## Contributing
|
|
44
95
|
|
|
45
|
-
|
|
46
|
-
|
|
96
|
+
- We're open to all community contributions!
|
|
97
|
+
- Read our [Contribution Guidelines](https://c15t.com/docs/oss/contributing)
|
|
98
|
+
- Review our [Code of Conduct](https://c15t.com/docs/oss/code-of-conduct)
|
|
99
|
+
- Fork the repository
|
|
100
|
+
- Create a new branch for your feature
|
|
101
|
+
- Submit a pull request
|
|
102
|
+
- **All contributions, big or small, are welcome and appreciated!**
|
|
47
103
|
|
|
48
|
-
|
|
49
|
-
* **Next.js**: [`@c15t/nextjs`](https://www.npmjs.com/package/@c15t/nextjs)
|
|
104
|
+
## Security
|
|
50
105
|
|
|
51
|
-
|
|
106
|
+
If you believe you have found a security vulnerability in c15t, we encourage you to **_responsibly disclose this and NOT open a public issue_**. We will investigate all legitimate reports.
|
|
52
107
|
|
|
53
|
-
|
|
108
|
+
Our preference is that you make use of GitHub's private vulnerability reporting feature to disclose potential security vulnerabilities in our Open Source Software. To do this, please visit [https://github.com/c15t/c15t/security](https://github.com/c15t/c15t/security) and click the "Report a vulnerability" button.
|
|
54
109
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
110
|
+
### Security Policy
|
|
111
|
+
|
|
112
|
+
- Please do not share security vulnerabilities in public forums, issues, or pull requests
|
|
113
|
+
- Provide detailed information about the potential vulnerability
|
|
114
|
+
- Allow reasonable time for us to address the issue before any public disclosure
|
|
115
|
+
- We are committed to addressing security concerns promptly and transparently
|
|
58
116
|
|
|
59
117
|
## License
|
|
60
118
|
|
|
61
|
-
[GNU General Public License v3.0](https://github.com/c15t/c15t/blob/main/LICENSE)
|
|
119
|
+
[GNU General Public License v3.0](https://github.com/c15t/c15t/blob/main/LICENSE.md)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
**Built with ❤️ by the [consent.io](https://www.consent.io?utm_source=github&utm_medium=repopage_c15t) team**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* c15t backend implementation of the consent client interface.
|
|
3
3
|
* This client makes HTTP requests to the c15t consent management backend.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConsentManagerInterface, SetConsentRequestBody, SetConsentResponse, ShowConsentBannerResponse, VerifyConsentRequestBody, VerifyConsentResponse } from './client-interface';
|
|
6
6
|
import { type FetchOptions, type ResponseContext, type RetryConfig } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* Configuration options for the c15t backend client
|
|
@@ -22,10 +22,6 @@ export interface C15tClientOptions {
|
|
|
22
22
|
* A custom fetch implementation to use instead of the global fetch.
|
|
23
23
|
*/
|
|
24
24
|
customFetch?: typeof fetch;
|
|
25
|
-
/**
|
|
26
|
-
* Global callbacks for handling API responses.
|
|
27
|
-
*/
|
|
28
|
-
callbacks?: ConsentManagerCallbacks;
|
|
29
25
|
/**
|
|
30
26
|
* CORS mode for fetch requests.
|
|
31
27
|
* @default 'cors'
|
|
@@ -58,11 +54,6 @@ export declare class C15tClient implements ConsentManagerInterface {
|
|
|
58
54
|
* @internal
|
|
59
55
|
*/
|
|
60
56
|
private customFetch?;
|
|
61
|
-
/**
|
|
62
|
-
* Callback functions for client events
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
private callbacks?;
|
|
66
57
|
/**
|
|
67
58
|
* CORS mode for fetch requests
|
|
68
59
|
* @internal
|
|
@@ -87,16 +78,6 @@ export declare class C15tClient implements ConsentManagerInterface {
|
|
|
87
78
|
* @returns The resolved URL string
|
|
88
79
|
*/
|
|
89
80
|
private resolveUrl;
|
|
90
|
-
/**
|
|
91
|
-
* Returns the client's configured callbacks.
|
|
92
|
-
*
|
|
93
|
-
* @returns The callbacks object or undefined if no callbacks are configured
|
|
94
|
-
*/
|
|
95
|
-
getCallbacks(): ConsentManagerCallbacks | undefined;
|
|
96
|
-
/**
|
|
97
|
-
* Sets the client's callback functions.
|
|
98
|
-
*/
|
|
99
|
-
setCallbacks(callbacks: ConsentManagerCallbacks): void;
|
|
100
81
|
/**
|
|
101
82
|
* Creates a response context object for success or error cases.
|
|
102
83
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-c15t.d.ts","sourceRoot":"","sources":["../../src/client/client-c15t.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"client-c15t.d.ts","sourceRoot":"","sources":["../../src/client/client-c15t.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,MAAM,SAAS,CAAC;AAgBjB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B;AAuCD;;;GAGG;AACH,qBAAa,UAAW,YAAW,uBAAuB;IACzD;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAS;IAE3B;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAyB;IAExC;;;OAGG;IACH,OAAO,CAAC,WAAW,CAAC,CAAe;IAEnC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAc;IAE9B;;;OAGG;IACH,OAAO,CAAC,WAAW,CAAc;IAEjC;;;;OAIG;gBACS,OAAO,EAAE,iBAAiB;IA0CtC;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAwBlB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoB7B;;OAEG;YACW,OAAO;IAsSrB;;;OAGG;IACG,iBAAiB,CACtB,OAAO,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,GAC/C,OAAO,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAyDtD;;;;OAIG;YACW,+BAA+B;IAmD7C;;;OAGG;IACG,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAqD/C;;;;OAIG;YACW,4BAA4B;IAmF1C;;OAEG;IACG,aAAa,CAClB,OAAO,CAAC,EAAE,YAAY,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GACrE,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAYlD;;OAEG;IACG,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACjE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAIzC;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IA2CtC;;;OAGG;YACW,yBAAyB;CA2EvC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Custom implementation of the consent client interface.
|
|
3
3
|
* This client uses provided handlers instead of making HTTP requests.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConsentManagerInterface, SetConsentRequestBody, SetConsentResponse, ShowConsentBannerResponse, VerifyConsentRequestBody, VerifyConsentResponse } from './client-interface';
|
|
6
6
|
import type { FetchOptions, ResponseContext } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* Handler function for a specific endpoint
|
|
@@ -33,10 +33,6 @@ export interface CustomClientOptions {
|
|
|
33
33
|
* Custom endpoint handlers
|
|
34
34
|
*/
|
|
35
35
|
endpointHandlers: EndpointHandlers;
|
|
36
|
-
/**
|
|
37
|
-
* Global callbacks for handling responses
|
|
38
|
-
*/
|
|
39
|
-
callbacks?: ConsentManagerCallbacks;
|
|
40
36
|
}
|
|
41
37
|
/**
|
|
42
38
|
* Custom implementation of the consent client interface.
|
|
@@ -53,27 +49,12 @@ export declare class CustomClient implements ConsentManagerInterface {
|
|
|
53
49
|
* @internal
|
|
54
50
|
*/
|
|
55
51
|
private dynamicHandlers;
|
|
56
|
-
/**
|
|
57
|
-
* Callback functions for client events
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
private callbacks?;
|
|
61
52
|
/**
|
|
62
53
|
* Creates a new custom client instance.
|
|
63
54
|
*
|
|
64
55
|
* @param options - Configuration options for the client
|
|
65
56
|
*/
|
|
66
57
|
constructor(options: CustomClientOptions);
|
|
67
|
-
/**
|
|
68
|
-
* Returns the client's configured callbacks.
|
|
69
|
-
*
|
|
70
|
-
* @returns The callbacks object or undefined if no callbacks are configured
|
|
71
|
-
*/
|
|
72
|
-
getCallbacks(): ConsentManagerCallbacks | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* Sets the client's callback functions.
|
|
75
|
-
*/
|
|
76
|
-
setCallbacks(callbacks: ConsentManagerCallbacks): void;
|
|
77
58
|
/**
|
|
78
59
|
* Creates a basic response context for error cases.
|
|
79
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-custom.d.ts","sourceRoot":"","sources":["../../src/client/client-custom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"client-custom.d.ts","sourceRoot":"","sources":["../../src/client/client-custom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK7D;;GAEG;AACH,MAAM,MAAM,eAAe,CAC1B,YAAY,GAAG,OAAO,EACtB,QAAQ,GAAG,OAAO,EAClB,SAAS,GAAG,OAAO,IAChB,CACH,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,KACrD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,iBAAiB,EAAE,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAE9D;;OAEG;IACH,UAAU,EAAE,eAAe,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAEvE;;OAEG;IACH,aAAa,EAAE,eAAe,CAC7B,qBAAqB,EACrB,wBAAwB,CACxB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;CACnC;AAED;;;GAGG;AACH,qBAAa,YAAa,YAAW,uBAAuB;IAC3D;;;OAGG;IACH,OAAO,CAAC,gBAAgB,CAAmB;IAE3C;;;OAGG;IACH,OAAO,CAAC,eAAe,CAGhB;IAEP;;;;OAIG;gBACS,OAAO,EAAE,mBAAmB;IAIxC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B;;OAEG;YACW,cAAc;IA6D5B;;OAEG;IACG,iBAAiB,CACtB,OAAO,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,GAC/C,OAAO,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAOtD;;OAEG;IACG,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAO/C;;OAEG;IACG,aAAa,CAClB,OAAO,CAAC,EAAE,YAAY,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GACrE,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAOlD;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACpE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,eAAe,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACzD,IAAI;IAQP;;OAEG;IACG,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACjE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;CAwCzC"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { StoreOptions } from '../store';
|
|
7
7
|
import { type EndpointHandlers } from './client-custom';
|
|
8
|
-
import type {
|
|
9
|
-
export type { ConsentManagerCallbacks, ConsentManagerInterface, } from './client-interface';
|
|
8
|
+
import type { ConsentManagerInterface } from './client-interface';
|
|
10
9
|
import type { RetryConfig } from './types';
|
|
10
|
+
export type { ConsentManagerInterface } from './client-interface';
|
|
11
11
|
export type { FetchOptions, ResponseContext, RetryConfig } from './types';
|
|
12
12
|
/**
|
|
13
13
|
* Configuration for Custom mode
|
|
@@ -23,10 +23,6 @@ export type CustomClientOptions = {
|
|
|
23
23
|
* Implement your own logic for each API operation
|
|
24
24
|
*/
|
|
25
25
|
endpointHandlers: EndpointHandlers;
|
|
26
|
-
/**
|
|
27
|
-
* Global callbacks for request events
|
|
28
|
-
*/
|
|
29
|
-
callbacks?: ConsentManagerCallbacks;
|
|
30
26
|
/**
|
|
31
27
|
* Store configuration options
|
|
32
28
|
*/
|
|
@@ -80,10 +76,6 @@ export type OfflineClientOptions = {
|
|
|
80
76
|
* Union type of all possible client options
|
|
81
77
|
*/
|
|
82
78
|
export type ConsentManagerOptions = {
|
|
83
|
-
/**
|
|
84
|
-
* Client callbacks
|
|
85
|
-
*/
|
|
86
|
-
callbacks?: ConsentManagerCallbacks;
|
|
87
79
|
store?: StoreOptions;
|
|
88
80
|
} & (CustomClientOptions | C15TClientOptions | OfflineClientOptions);
|
|
89
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../src/client/client-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../src/client/client-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA4C1E;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,GAAG,CAAC,mBAAmB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,qBAAqB,GAC5B,uBAAuB,CAuEzB"}
|