@c15t/node-sdk 1.8.0-canary-20251028143243 → 1.8.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 +2 -2
- package/dist/index.js +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://github.com/c15t/c15t)
|
|
13
13
|
[](https://github.com/c15t/c15t/actions/workflows/ci.yml)
|
|
14
14
|
[](https://github.com/c15t/c15t/blob/main/LICENSE.md)
|
|
15
|
-
[](https://c15t.
|
|
15
|
+
[](https://c15t.link/discord)
|
|
16
16
|
[](https://www.npmjs.com/package/@c15t/node-sdk)
|
|
17
17
|
[](https://github.com/c15t/c15t)
|
|
18
18
|
[](https://github.com/c15t/c15t/commits/main)
|
|
@@ -48,7 +48,7 @@ pnpm add @c15t/node-sdk
|
|
|
48
48
|
|
|
49
49
|
## Support
|
|
50
50
|
|
|
51
|
-
- Join our [Discord community](https://c15t.
|
|
51
|
+
- Join our [Discord community](https://c15t.link/discord)
|
|
52
52
|
- Open an issue on our [GitHub repository](https://github.com/c15t/c15t/issues)
|
|
53
53
|
- Visit [consent.io](https://consent.io) and use the chat widget
|
|
54
54
|
- Contact our support team via email [support@consent.io](mailto:support@consent.io)
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { contracts } from "@c15t/backend/contracts";
|
|
2
|
+
import { createORPCClient } from "@orpc/client";
|
|
3
|
+
import { OpenAPILink } from "@orpc/openapi-client/fetch";
|
|
4
4
|
function c15tClient(options) {
|
|
5
5
|
const authHeaders = options.token ? {
|
|
6
6
|
Authorization: `Bearer ${options.token}`
|
|
7
7
|
} : {};
|
|
8
8
|
const baseUrl = new URL(options.baseUrl);
|
|
9
9
|
if (options.prefix) baseUrl.pathname = options.prefix;
|
|
10
|
-
const link = new
|
|
10
|
+
const link = new OpenAPILink(contracts, {
|
|
11
11
|
url: baseUrl.toString(),
|
|
12
12
|
headers: {
|
|
13
13
|
...authHeaders,
|
|
14
14
|
...options.headers
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
return
|
|
17
|
+
return createORPCClient(link);
|
|
18
18
|
}
|
|
19
19
|
export { c15tClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/node-sdk",
|
|
3
|
-
"version": "1.8.0
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Official Node.js SDK for c15t. Connects to the Consent Engine to read and write consent records and preferences. TypeScript-first, simple APIs, built-in auth and retries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@orpc/contract": "1.8.1",
|
|
46
46
|
"@orpc/openapi-client": "^1.8.1",
|
|
47
47
|
"@orpc/server": "1.8.1",
|
|
48
|
-
"@c15t/backend": "1.8.0
|
|
48
|
+
"@c15t/backend": "1.8.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@electric-sql/pglite": "0.2.17",
|