---
title: "Installation Methods"
description: "Review our alternate installation methods."
url: https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/
---

# Installation Methods | Sentry for Cloudflare

* #### [Vite Plugin](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/vite-plugin.md)

  Learn how to use the Sentry Cloudflare Vite plugin to instrument bundled dependencies at build time.

* #### [Wrangler](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/wrangler.md)

  Learn how to instrument a Cloudflare Worker built with Wrangler, using the withSentry wrapper.

## [How To Decide Which Installation Method To Use](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install.md#how-to-decide-which-installation-method-to-use)

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.

### [If You Build Your Worker With Vite](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install.md#if-you-build-your-worker-with-vite)

Follow the [quick start](https://docs.sentry.io/platforms/javascript/guides/cloudflare.md), which sets Sentry up this way. This is what we recommend: the [Vite plugin](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/vite-plugin.md) 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](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/vite-plugin.md) page for its options and what it instruments.

### [If You Deploy Directly With `wrangler`](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install.md#if-you-deploy-directly-with-wrangler)

Follow the [Wrangler setup](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/wrangler.md) 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.

### [If You're Deploying a Cloudflare Pages Application](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install.md#if-youre-deploying-a-cloudflare-pages-application)

Follow [Cloudflare Pages](https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/pages.md), which uses the `sentryPagesPlugin` middleware instead of a wrapper. Cloudflare recommends [moving to Workers with static assets](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) for new projects.

## Pages in this section

- [Vite Plugin](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/vite-plugin.md)
- [Wrangler](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/wrangler.md)
