The CLI is a library (npm)
npm install sentry ships both the CLI and a typed SDK — no subprocess.
import createSentrySDK from "sentry";
const sdk = createSentrySDK({ token: "sntrys_..." });
const issues = await sdk.issue.list({ orgProject: "acme/frontend", limit: 5 });
const issue = await sdk.issue.view({ issue: "ACME-123" });
const version = await sdk.run("--version");
- In-process (no spawn) · parsed objects (zero-copy) · typed
SentryError
- Never touches your
process.env; streaming commands return async iterables
Same code path as the CLI — just callable. Great for build tools, CI, and agents.