Cloudflare Enablement
Pages
Testing
Edit this page on GitHub
Set theme to dark (⇧+D)

Sentry Pages Plugin

The Sentry Pages Plugin captures and logs all exceptions which occur below it in the execution chain of your Pages Functions. It is therefore recommended that you install this Plugin at the root of your application in functions/_middleware.ts as the very first Plugin.

​​ Installation

​​ Usage

The Plugin uses Toucan . Refer to the Toucan README to review the options it can take . context, request, and event are automatically populated and should not be manually configured.

If your DSN is held as an environment variable or in KV, you can access it like so:

​​ Additional context

If you need to set additional context for Sentry (for example, user information or additional logs), use the data.sentry instance in any Function below the Plugin in the execution chain.

For example, you can access data.sentry and set user information like so:

Again, the full list of features can be found in Toucan’s documentation .