Installation Methods for Cloudflare
Review our alternate installation methods.
How you set the SDK up depends on how your Worker is built, not on which features you want. All methods give you the same errors, traces, and options.
Follow the quick start, which sets Sentry up this way. This is what we recommend: the Vite plugin wraps your Worker entry at build time, so you don't write the wrapper yourself, and it instruments bundled dependencies such as database clients, which is the only way to trace them in the Workers runtime. See the Vite Plugin page for its options and what it instruments.
Follow the Wrangler setup and wrap your entry with Sentry.withSentry() yourself. You keep errors and request traces, but you lose the build-time instrumentation of bundled dependencies, so spans from those packages won't appear.
Follow Cloudflare Pages, which uses the sentryPagesPlugin middleware instead of a wrapper. Cloudflare recommends moving to Workers with static assets for new projects.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").