sentry 0.20.0 → 0.21.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 +32 -0
- package/dist/bin.cjs +1 -1996
- package/dist/index.cjs +2089 -0
- package/dist/index.d.cts +652 -0
- package/package.json +26 -12
package/README.md
CHANGED
|
@@ -83,6 +83,38 @@ For detailed documentation, visit [cli.sentry.dev](https://cli.sentry.dev).
|
|
|
83
83
|
|
|
84
84
|
Credentials are stored in `~/.sentry/` with restricted permissions (mode 600).
|
|
85
85
|
|
|
86
|
+
## Library Usage
|
|
87
|
+
|
|
88
|
+
Use Sentry CLI programmatically in Node.js (≥22) or Bun without spawning a subprocess:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import createSentrySDK from "sentry";
|
|
92
|
+
|
|
93
|
+
const sdk = createSentrySDK({ token: "sntrys_..." });
|
|
94
|
+
|
|
95
|
+
// Typed methods for every CLI command
|
|
96
|
+
const orgs = await sdk.org.list();
|
|
97
|
+
const issues = await sdk.issue.list({ orgProject: "acme/frontend", limit: 5 });
|
|
98
|
+
const issue = await sdk.issue.view({ issue: "ACME-123" });
|
|
99
|
+
|
|
100
|
+
// Nested commands
|
|
101
|
+
await sdk.dashboard.widget.add({ display: "line", query: "count" }, "my-org/my-dashboard");
|
|
102
|
+
|
|
103
|
+
// Escape hatch for any CLI command
|
|
104
|
+
const version = await sdk.run("--version");
|
|
105
|
+
const text = await sdk.run("issue", "list", "-l", "5");
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Options (all optional):
|
|
109
|
+
- `token` — Auth token. Falls back to `SENTRY_AUTH_TOKEN` / `SENTRY_TOKEN` env vars.
|
|
110
|
+
- `url` — Sentry instance URL for self-hosted (e.g., `"sentry.example.com"`).
|
|
111
|
+
- `org` — Default organization slug (avoids passing it on every call).
|
|
112
|
+
- `project` — Default project slug.
|
|
113
|
+
- `text` — Return human-readable string instead of parsed JSON (affects `run()` only).
|
|
114
|
+
- `cwd` — Working directory for DSN auto-detection. Defaults to `process.cwd()`.
|
|
115
|
+
|
|
116
|
+
Errors are thrown as `SentryError` with `.exitCode` and `.stderr`.
|
|
117
|
+
|
|
86
118
|
---
|
|
87
119
|
|
|
88
120
|
## Development
|