You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/platforms/javascript/common/install/index.mdx
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,3 +20,36 @@ notSupported:
20
20
---
21
21
22
22
<PageGrid />
23
+
24
+
## How To Decide Which Installation Method To Use
25
+
26
+
Depending on the concrete needs of your application, you may wonder which installation method you should use.
27
+
28
+
### Why Choose the Loader Script Over NPM
29
+
30
+
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.
31
+
32
+
-**Easy to set up**: Just [add a script tag](./loader/#using-the-loader) to your application.
33
+
34
+
-**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.
35
+
36
+
-**Easy to add additional configuration**: You can [configure the SDK](./loader/#sdk-configuration) to your liking via `Sentry.onLoad()`.
37
+
38
+
-**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.
39
+
40
+
<Note>
41
+
Note that when enabling Session Replay and/or Performance Monitoring, the
42
+
SDK will be loaded immediately because we need to capture what's happening
43
+
on the page as early as possible.
44
+
</Note>
45
+
46
+
### Why Choose NPM Over the Loader Script
47
+
48
+
While using the Loader Script has definite advantages, it also comes with some drawbacks.
49
+
In these scenarios, using the npm package is the better choice:
50
+
51
+
-**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.
52
+
53
+
-**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.
54
+
55
+
-**Full control over the SDK version**: If you need full control over the SDK version, you'll need to install the SDK via npm.
0 commit comments