---
title: "ContextLines"
description: "Adds source code from inline JavaScript of the current page's HTML."
url: https://docs.sentry.io/platforms/javascript/guides/svelte/configuration/integrations/contextlines/
---

# ContextLines | Sentry for Svelte

*Import name: `Sentry.contextLinesIntegration`*

This integration adds source code from inline JavaScript of the current page's HTML (e.g. JS in `<script>` tags) to stack traces of captured errors. It *can't* collect source code from assets referenced by your HTML (e.g. `<script src="..." />`).

The `ContextLines` integration is useful when you have inline JS code in HTML pages that can't be accessed by Sentry's backend, for example, due to a login-protected page.

```javascript
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  integrations: [Sentry.contextLinesIntegration()],
});
```

## [Options](https://docs.sentry.io/platforms/javascript/guides/svelte/configuration/integrations/contextlines.md#options)

### [`frameContextLines`](https://docs.sentry.io/platforms/javascript/guides/svelte/configuration/integrations/contextlines.md#framecontextlines)

*Type: `number`*

The number of lines to collect around each stack frame's line number. Defaults to 7.
