---
title: "BunServer"
description: "Instruments Bun.serve to automatically create transactions and capture errors. (default)"
url: https://docs.sentry.io/platforms/javascript/guides/bun/configuration/integrations/bunserver/
---

# BunServer | Sentry for Bun

This integration only works in the Bun runtime.

*Import name: `Sentry.bunServerIntegration`*

This integration is enabled by default. If you'd like to modify your default integrations, read [this](https://docs.sentry.io/platforms/javascript/guides/bun/configuration/integrations.md#modifying-default-integrations).

The `bunServerIntegration` instruments [`Bun.serve` API](https://bun.sh/docs/api/http) to automatically create transactions and capture errors.

```JavaScript
import * as Sentry from '@sentry/bun';

Sentry.init({
  integrations: [Sentry.bunServerIntegration()],
});
```
