# Demo: Sentry monitoring with SDK

### Turn Production Errors into Draft PRs with Cloud Agents + TypeScript SDK

{% embed url="<https://www.youtube.com/watch?feature=youtu.be&v=fHQXLg9ybi4>" %}

{% hint style="info" %}
Example repository: [**https://github.com/warpdotdev/warp-agents-sdk-demo-sentry-monitor**](https://github.com/warpdotdev/warp-agents-sdk-demo-sentry-monitor)
{% endhint %}

In this demo, Ben builds a small TypeScript “Sentry monitor” service that listens for specific Sentry alerts (like a Go nil pointer dereference) and triggers a Warp cloud agent to investigate. The server validates the webhook, extracts the stack trace, and injects it into an agent run inside a Warp Environment so the agent can inspect the repo and propose a fix.

He also covers the task lifecycle basics in the TypeScript SDK (running an agent, polling task state to fetch a session link for debugging), and shows the end result: a draft GitHub pull request created from the Sentry event for a maintainer to review.

**What Ben covers**

* Using Warp's TypeScript SDK to trigger agent runs and retrieve run details.
* Handling run lifecycle states (queued → running) to reliably fetch a session link.
* Running agents inside a Warp Environment so they can investigate real code, run tests, and validate fixes.
* Building a lightweight Sentry webhook server that filters, validates, and routes only the right errors to an agent.
* Creating a workflow that results in draft PRs for human review, instead of silent autonomous changes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.warp.dev/reference/api-and-sdk/demo-sentry-monitoring-with-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
