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

# Installation Methods | Sentry for JavaScript

* #### [NPM](https://docs.sentry.io/platforms/javascript/install/npm.md)

  Learn about installing with NPM.

* #### [Loader Script](https://docs.sentry.io/platforms/javascript/install/loader.md)

  Learn about the Sentry JavaScript Loader Script

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

Depending on the concrete needs of your application, you may wonder which installation method you should use.

### [Why Choose the Loader Script Over NPM](https://docs.sentry.io/platforms/javascript/install.md#why-choose-the-loader-script-over-npm)

Using the Loader Script is the easiest way to start using Sentry. Add a script tag to your application, and we'll take care of setting everything else up correctly for you.

* **Easy to set up**: Just [add a script tag](https://docs.sentry.io/platforms/javascript/install/loader.md#using-the-loader) to your application.

* **Easy to upgrade**: We'll take care of always shipping the latest version of the SDK to your users. No action's needed from you. This ensures you'll always get the latest features and bug fixes of the Sentry SDK.

* **Easy to add additional configuration**: You can [configure the SDK](https://docs.sentry.io/platforms/javascript/install/loader.md#sdk-configuration) to your liking via `window.sentryOnLoad`.

* **Lazy-loading**: If you just want to use Sentry for errors, we'll only load the SDK when an error occurs, reducing the amount of JavaScript loaded on your page until then.

  Note that when enabling Session Replay and/or Tracing, the SDK will be loaded immediately because we need to capture what's happening on the page as early as possible.

### [Why Choose NPM Over the Loader Script](https://docs.sentry.io/platforms/javascript/install.md#why-choose-npm-over-the-loader-script)

While using the Loader Script has definite advantages, it also comes with some drawbacks. In these scenarios, using the npm package is the better choice:

* **Framework-specific initialization**: As of now, the Loader Script only provides generic Browser JavaScript instrumentation. This means that you won't get any React, Vue, or similar framework-specific features for Sentry. To get these features, you'll need to install the framework SDK (e.g. `@sentry/react` or `@sentry/vue`) via npm.

* **Full public API**: The Loader Script only exposes a subset of public APIs (for example, `Sentry.captureException()`, ...). If you need a lot of custom functionality, you're likely better off with the npm package.

* **Full control over the SDK version**: If you need full control over the SDK version, you'll need to install the SDK via npm.

## Pages in this section

- [NPM](https://docs.sentry.io/platforms/javascript/install/npm.md)
- [Loader Script](https://docs.sentry.io/platforms/javascript/install/loader.md)
