@sentry/api 0.255.0 → 0.256.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 CHANGED
@@ -29,6 +29,37 @@ console.log(data);
29
29
 
30
30
  Auth tokens and base URLs (including self-hosted and region URLs) are documented at https://docs.sentry.io/api/auth/.
31
31
 
32
+ ## Runtime validation
33
+
34
+ The root `@sentry/api` entry has no runtime dependencies. It provides the API client and pure TypeScript types without installing a validation library.
35
+
36
+ Valibot 1 runtime schemas are available through a separate optional entry point:
37
+
38
+ ```bash
39
+ npm install @sentry/api valibot
40
+ ```
41
+
42
+ ```ts
43
+ import * as v from "valibot";
44
+ import { vGetProjectResponse } from "@sentry/api/valibot";
45
+
46
+ const project = v.parse(vGetProjectResponse, input);
47
+ ```
48
+
49
+ The existing Zod 3 entry remains supported:
50
+
51
+ ```bash
52
+ npm install @sentry/api zod
53
+ ```
54
+
55
+ ```ts
56
+ import { zGetProjectResponse } from "@sentry/api/zod";
57
+
58
+ const project = zGetProjectResponse.parse(input);
59
+ ```
60
+
61
+ `valibot` and `zod` are optional peer dependencies. Install neither when you only need the generated client and TypeScript types, or install the validator used by your application. The `@sentry/api/valibot` entry requires Valibot 1; its optional peer uses a wildcard because npm applies peer constraints to the whole package, including consumers that never import this entry.
62
+
32
63
  ## Error handling
33
64
 
34
65
  Every operation with documented error responses has a generated `narrowError_<operation>` wrapper. It returns data or a `SentryApiError` that preserves the operation's status-to-body type map:
@@ -0,0 +1 @@
1
+ export * from "./valibot.gen.ts";