@c15t/node-sdk 3.0.0-alpha.7 → 3.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 +14 -22
- package/dist/index.js +1 -2
- package/dist-types/version.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://c15t.com?utm_source=npm&utm_medium=readme&utm_campaign=oss_readme&utm_content=%40c15t%2Fnode-sdk" target="_blank" rel="noopener noreferrer">
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="../../docs/assets/c15t-banner-readme-dark.
|
|
5
|
-
<img src="../../docs/assets/c15t-banner-readme-light.
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="../../docs/assets/c15t-banner-readme-dark.png">
|
|
5
|
+
<img src="../../docs/assets/c15t-banner-readme-light.png" alt="c15t: the open standard for cookie banners">
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
Typed client for hosted and self-hosted c15t backends. Check consent before sending email, link users after sign-in, export a user's consent records, publish legal document releases from CI and read banner experiment results.
|
|
22
22
|
|
|
23
|
+
c15t is used by [2,100+ sites](https://www.wappalyzer.com/technologies/cookie-compliance/c15t/), including expo.dev, zed.dev, unkey.dev, mintlify.com, and sazabi.com.
|
|
24
|
+
|
|
23
25
|
## Key Features
|
|
24
26
|
|
|
25
27
|
- One `createC15tClient()` call with an explicit backend URL. No environment variables are read
|
|
@@ -34,10 +36,10 @@ Typed client for hosted and self-hosted c15t backends. Check consent before send
|
|
|
34
36
|
- Node.js 20.19 or later, or another runtime with `fetch`, `AbortSignal.any` and `crypto.randomUUID`
|
|
35
37
|
- A hosted [c15t instance](https://inth.com) or a [self-hosted backend](https://c15t.com/docs/self-host/quickstart)
|
|
36
38
|
|
|
37
|
-
##
|
|
39
|
+
## Installation
|
|
38
40
|
|
|
39
41
|
```bash
|
|
40
|
-
pnpm add @c15t/node-sdk
|
|
42
|
+
pnpm add @c15t/node-sdk
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
## Usage
|
|
@@ -71,7 +73,7 @@ if (result.ok && result.data.results.marketing_communications.hasConsent) {
|
|
|
71
73
|
|
|
72
74
|
## Documentation
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
See the [documentation](https://c15t.com/docs/self-host/api/node-sdk) for guides, API reference, and examples.
|
|
75
77
|
|
|
76
78
|
## Methods
|
|
77
79
|
|
|
@@ -92,7 +94,7 @@ Every method takes `{ signal, timeoutMs, headers, retry, requestId }` as its las
|
|
|
92
94
|
|
|
93
95
|
## Upgrading from v2
|
|
94
96
|
|
|
95
|
-
`c15tClient()` and the `C15TClient` class are replaced by `createC15tClient()`. Results replace `ResponseContext`, `C15TError` is now `C15tError`, and `subjects.patch` is now `subjects.identify`. See the [migration guide](https://c15t.com/docs/upgrade-v3#update-the-nodejs-sdk).
|
|
97
|
+
`c15tClient()` and the `C15TClient` class are replaced by `createC15tClient()`. Results replace `ResponseContext`, `C15TError` is now `C15tError`, and `subjects.patch` is now `subjects.identify`. See the [migration guide](https://c15t.com/docs/self-host/upgrade-v3#update-the-nodejs-sdk).
|
|
96
98
|
|
|
97
99
|
## Support
|
|
98
100
|
|
|
@@ -103,26 +105,16 @@ Every method takes `{ signal, timeoutMs, headers, retry, requestId }` as its las
|
|
|
103
105
|
|
|
104
106
|
## Contributing
|
|
105
107
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
- Review our [Code of Conduct](https://c15t.com/docs/oss/code-of-conduct)
|
|
109
|
-
- Fork the repository
|
|
110
|
-
- Create a new branch for your feature
|
|
111
|
-
- Submit a pull request
|
|
112
|
-
- **All contributions, big or small, are welcome and appreciated.**
|
|
108
|
+
- Read the [contribution guidelines](https://c15t.com/docs/oss/contributing) before you open a pull request
|
|
109
|
+
- Follow the [code of conduct](https://c15t.com/docs/oss/code-of-conduct)
|
|
113
110
|
|
|
114
111
|
## Security
|
|
115
112
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
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.
|
|
119
|
-
|
|
120
|
-
### Security Policy
|
|
113
|
+
Do not open a public issue for a security vulnerability. Report it privately through [GitHub's vulnerability reporting](https://github.com/c15t/c15t/security/advisories/new). We examine every valid report.
|
|
121
114
|
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
- We are committed to addressing security concerns promptly and transparently
|
|
115
|
+
- Do not share the vulnerability in public forums, issues, or pull requests
|
|
116
|
+
- Give the steps to reproduce it and the versions it affects
|
|
117
|
+
- Give us time to release a fix before you disclose it
|
|
126
118
|
|
|
127
119
|
## License
|
|
128
120
|
|
package/dist/index.js
CHANGED
|
@@ -738,7 +738,6 @@ const path_buildPath = function(template, params) {
|
|
|
738
738
|
const values = params;
|
|
739
739
|
return template.replace(/:(?<name>[A-Za-z]+)/gu, (_match, name)=>encodeURIComponent(values[name] ?? ''));
|
|
740
740
|
};
|
|
741
|
-
const version = '3.0.0-alpha.7';
|
|
742
741
|
const RETRYABLE_STATUSES = new Set([
|
|
743
742
|
408,
|
|
744
743
|
429,
|
|
@@ -751,7 +750,7 @@ const ownedHeaders = (options, requestId, hasBody)=>{
|
|
|
751
750
|
const headers = {
|
|
752
751
|
accept: 'application/json',
|
|
753
752
|
[POLICY_CONTRACT_HEADER]: String(POLICY_CONTRACT_VERSION),
|
|
754
|
-
'x-c15t-version':
|
|
753
|
+
'x-c15t-version': "3.0.0",
|
|
755
754
|
'x-request-id': requestId
|
|
756
755
|
};
|
|
757
756
|
if (hasBody) headers['content-type'] = 'application/json';
|
package/dist-types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "3.0.0
|
|
1
|
+
export declare const version = "3.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/node-sdk",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Typed client for the c15t consent API: check consent, link users, record consents and publish legal documents from server code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"c15t",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"test:watch": "bun prebuild && vitest"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@c15t/schema": "3.0.0
|
|
65
|
+
"@c15t/schema": "3.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@c15t/backend": "3.0.0
|
|
68
|
+
"@c15t/backend": "3.0.0",
|
|
69
69
|
"@c15t/typescript-config": "0.0.1",
|
|
70
70
|
"@c15t/vitest-config": "1.0.0",
|
|
71
71
|
"@types/node": "25.5.0",
|