# Integrating using an AI prompt

The Integrate with AI section shows you a **ready-made prompt** for a simple integration of Better Stack error tracking into your app using Claude Code or Cursor.

1. Navigate to **Errors** -> [Applications](https://errors.betterstack.com/team/t0/applications/ ";_blank") -> Your application -> **Data ingestion**.
2. Scroll to **Integrate with AI** and click on the prompt to copy it.
3. Use it in Claude Code or similar tool to automatically integrate Better Stack into your application.

![Integrate with AI](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/26ea38a3-3dba-4d4a-542e-03e57ebaa600/md1x =2280x858)

[info]
#### Not using Claude Code or similar agentic dev-tool?

You can integrate your app manually using [Sentry SDK](https://betterstack.com/docs/errors/collecting-errors/sentry-sdk/).
[/info]

## Examples

Even if you use an AI agent, it's helpful to see what the final integration code looks like. Here are a few examples of how to use the Sentry SDK:

[code-tabs]
```javascript
[label JavaScript]
import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://$APPLICATION_TOKEN@$INGESTING_HOST/1",
  // To capture performance monitoring data,
  // you must set tracesSampleRate
  tracesSampleRate: 1.0,
});

// Example of capturing an exception
try {
  throw new Error("This is a test error from the browser!");
} catch (e) {
  Sentry.captureException(e);
}
```
```python
[label Python]
import sentry_sdk

sentry_sdk.init(
    dsn="https://$APPLICATION_TOKEN@$INGESTING_HOST/1",
    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for performance monitoring.
    traces_sample_rate=1.0,
)

# Example of capturing an exception
try:
    1 / 0
except ZeroDivisionError as e:
    sentry_sdk.capture_exception(e)
```
```ruby
[label Ruby]
require 'sentry-ruby'

Sentry.init do |config|
  config.dsn = 'https://$APPLICATION_TOKEN@$INGESTING_HOST/1'
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]

  # To activate performance monitoring, set one of these options.
  # We recommend adjusting the value in production:
  config.traces_sample_rate = 1.0
end

# Example of capturing an exception
begin
  1 / 0
rescue ZeroDivisionError => exception
  Sentry.capture_exception(exception)
end
```
[/code-tabs]

[info]
#### Couldn't find example for your application?

Read our [Sentry SDK integration guide](https://betterstack.com/docs/errors/collecting-errors/sentry-sdk/) for more languages.
[/info]

## See the error in Better Stack

After running the prompt and triggering and error, you should see your first report in [Errors](https://errors.betterstack.com/team/0/errors ";_blank") 🚀

![First error in Better stack](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/5163c4ac-6b4e-4963-ddcc-41217c77e900/orig =4160x1376)
