Skip to content

Commit ba6181f

Browse files
HazATPeloWriter
andauthored
feat: Add Release Health to wizard (#2750)
* feat: Add Release Health to wizard * feat: Add session health to other frontend sdks * ref: Update backbone and angular1 wizard * Apply suggestions from code review Co-authored-by: Fiona <[email protected]> Co-authored-by: Fiona <[email protected]>
1 parent 88db5cb commit ba6181f

File tree

8 files changed

+65
-122
lines changed

8 files changed

+65
-122
lines changed

src/wizard/javascript/angular.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { AppModule } from "./app/app.module";
2929

3030
Sentry.init({
3131
dsn: "___PUBLIC_DSN___",
32+
autoSessionTracking: true,
3233
integrations: [
3334
new Integrations.BrowserTracing({
3435
tracingOrigins: ["localhost", "https://yourserver.io/api"],

src/wizard/javascript/angularjs.md

Lines changed: 29 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,43 @@
11
---
22
name: AngularJS
3-
doc_link: https://docs.sentry.io/clients/javascript/integrations/angularjs/
3+
doc_link: https://docs.sentry.io/platforms/javascript/guides/angular/angular1/
44
support_level: production
55
type: framework
66
---
77

8-
### Installation
8+
Install our Browser Angular SDK using either `yarn` or `npm`:
99

10-
Raven.js and the Raven.js Angular plugin are distributed using a few different methods.
10+
Add the Sentry SDK as a dependency using `yarn` or `npm`:
1111

12-
#### Using our CDN
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/browser @sentry/integrations
1315

14-
For convenience, our CDN serves a single, minified JavaScript file containing both Raven.js and the Raven.js AngularJS plugin. It should be included **after** Angular, but **before** your application code.
15-
16-
Example:
17-
18-
```html
19-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
20-
<script
21-
src="https://cdn.ravenjs.com/3.26.4/angular/raven.min.js"
22-
crossorigin="anonymous"
23-
></script>
24-
<script>
25-
Raven.config("___PUBLIC_DSN___").install();
26-
</script>
27-
```
28-
29-
Note that this CDN build auto-initializes the Angular plugin.
30-
31-
#### Using package managers
32-
33-
Pre-built distributions of Raven.js and the Raven.js AngularJS plugin are available via both Bower and npm.
34-
35-
##### Bower
36-
37-
```shell
38-
bower install raven-js --save
39-
```
40-
41-
```html
42-
<script src="/bower_components/angular/angular.js"></script>
43-
<script src="/bower_components/raven-js/dist/raven.js"></script>
44-
<script src="/bower_components/raven-js/dist/plugins/angular.js"></script>
45-
<script>
46-
Raven.config("___PUBLIC_DSN___")
47-
.addPlugin(Raven.Plugins.Angular)
48-
.install();
49-
</script>
50-
```
51-
52-
##### npm
53-
54-
```shell
55-
npm install raven-js --save
56-
```
57-
58-
```html
59-
<script src="/node_modules/angular/angular.js"></script>
60-
<script src="/node_modules/raven-js/dist/raven.js"></script>
61-
<script src="/node_modules/raven-js/dist/plugins/angular.js"></script>
62-
<script>
63-
Raven.config("___PUBLIC_DSN___")
64-
.addPlugin(Raven.Plugins.Angular)
65-
.install();
66-
</script>
67-
```
68-
69-
These examples assume that AngularJS is exported globally as _window.angular_. You can alternatively pass a reference to the _angular_ object directly as the second argument to _addPlugin_:
70-
71-
```javascript
72-
Raven.addPlugin(Raven.Plugins.Angular, angular);
73-
```
74-
75-
#### Module loaders (CommonJS)
76-
77-
Raven and the Raven AngularJS plugin can be loaded using a module loader like Browserify or Webpack.
78-
79-
```javascript
80-
var angular = require("angular");
81-
var Raven = require("raven-js");
82-
83-
Raven.config("___PUBLIC_DSN___")
84-
.addPlugin(require("raven-js/plugins/angular"), angular)
85-
.install();
86-
```
87-
88-
Note that when using CommonJS-style imports, you must pass a reference to _angular_ as the second argument to _addPlugin_.
89-
90-
### AngularJS Configuration
91-
92-
Inside your main AngularJS application module, you need to declare _ngRaven_ as a module dependency:
93-
94-
```javascript
95-
var myApp = angular.module("myApp", [
96-
"ngRaven",
97-
"ngRoute",
98-
"myAppControllers",
99-
"myAppFilters",
100-
]);
16+
# Using npm
17+
npm install --save @sentry/browser @sentry/integrations
10118
```
10219

103-
#### Module loaders (CommonJS) {#id1}
104-
105-
The raven angular module can be loaded using a module loader like Browserify or Webpack.
20+
`init` the Sentry Browser SDK as soon as possible during your page load, before initializing Angular:
10621

10722
```javascript
108-
var angular = require("angular");
109-
var ngRaven = require("raven-js/plugins/angular").moduleName;
110-
var ngRoute = require("angular-route");
111-
112-
var myAppFilters = require("./myAppFilters");
113-
var myAppControllers = require("./myAppControllers");
114-
var moduleName = "myApp";
115-
116-
angular.module(moduleName, [ngRaven, ngRoute, myAppControllers, myAppFilters]);
117-
118-
module.exports = moduleName;
23+
import angular from "angular";
24+
import * as Sentry from "@sentry/browser";
25+
import { Integrations } from "@sentry/tracing";
26+
import { Angular as AngularIntegration } from "@sentry/integrations";
27+
28+
Sentry.init({
29+
dsn: "___PUBLIC_DSN___",
30+
autoSessionTracking: true,
31+
integrations: [
32+
new AngularIntegration(),
33+
new Integrations.BrowserTracing({
34+
tracingOrigins: ["localhost", "https://yourserver.io/api"],
35+
}),
36+
],
37+
38+
tracesSampleRate: 1.0,
39+
});
40+
41+
// Finally require ngSentry as a dependency in your application module.
42+
angular.module("yourApplicationModule", ["ngSentry"]);
11943
```
120-
121-
<!-- TODO-ADD-VERIFICATION-EXAMPLE -->

src/wizard/javascript/backbone.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
11
---
22
name: Backbone
3-
doc_link: https://docs.sentry.io/clients/javascript/integrations/#backbone
3+
doc_link: https://docs.sentry.io/platforms/javascript/
44
support_level: production
55
type: framework
66
---
77

8-
### Installation
8+
Install our JavaScript browser SDK using either `yarn` or `npm`:
99

10-
Start by adding the `raven.js` script tag to your page. It should be loaded as early as possible.
11-
12-
```html
13-
<script
14-
src="https://cdn.ravenjs.com/3.26.4/raven.min.js"
15-
crossorigin="anonymous"
16-
></script>
10+
```bash {tabTitle: ESM}
11+
# Using yarn
12+
yarn add @sentry/browser @sentry/tracing
13+
# Using npm
14+
npm install --save @sentry/browser @sentry/tracing
1715
```
1816

19-
### Configuring the Client
17+
We also support alternate [installation methods](/platforms/javascript/install/).
2018

21-
Next configure Raven.js to use your Sentry DSN:
19+
`init` the Sentry Browser SDK as soon as possible during your page load:
2220

2321
```javascript
24-
Raven.config("___PUBLIC_DSN___").install();
22+
import * as Sentry from "@sentry/browser";
23+
import { Integrations } from "@sentry/tracing";
24+
25+
Sentry.init({
26+
dsn: '___PUBLIC_DSN___',
27+
autoSessionTracking: true,
28+
integrations: [
29+
new Integrations.BrowserTracing(),
30+
],
31+
tracesSampleRate: 1.0,
32+
});
33+
```
34+
35+
We recommend adjusting the value of `tracesSampleRate` in production. Learn more about configuring sampling in our [full documentation](https://docs.sentry.io/platforms/javascript/performance/sampling/).
36+
37+
Then create an intentional error, so you can test that everything is working:
38+
39+
```js
40+
myUndefinedFunction();
2541
```
2642

27-
At this point, Raven is ready to capture any uncaught exception.
43+
If you're new to Sentry, use the email alert to access your account and complete a product tour.
2844

29-
<!-- TODO-ADD-VERIFICATION-EXAMPLE -->
45+
If you're an existing user and have disabled alerts, you won't receive this email.

src/wizard/javascript/browser.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { Integrations } from "@sentry/tracing";
2424

2525
Sentry.init({
2626
dsn: '___PUBLIC_DSN___',
27+
autoSessionTracking: true,
2728
integrations: [
2829
new Integrations.BrowserTracing(),
2930
],

src/wizard/javascript/ember.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Then add the following config to your `config/environment.js`:
3737
ENV['@sentry/ember'] = {
3838
sentry: {
3939
dsn: '___PUBLIC_DSN___',
40-
40+
autoSessionTracking: true,
4141
// Set tracesSampleRate to 1.0 to capture 100%
4242
// of transactions for performance monitoring.
4343
// We recommend adjusting this value in production, or using tracesSampler

src/wizard/javascript/gatsby.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Register the plugin in your Gatsby configuration file (typically `gatsby-config.
2727
resolve: "@sentry/gatsby",
2828
options: {
2929
dsn: "___PUBLIC_DSN___",
30+
autoSessionTracking: true,
3031
sampleRate: 0.7,
3132
},
3233
},

src/wizard/javascript/react.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import App from "./App";
2626

2727
Sentry.init({
2828
dsn: "___PUBLIC_DSN___",
29+
autoSessionTracking: true,
2930
integrations: [
3031
new Integrations.BrowserTracing(),
3132
],

src/wizard/javascript/vue.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { Integrations } from "@sentry/tracing";
3636
Sentry.init({
3737
Vue,
3838
dsn: "___PUBLIC_DSN___",
39+
autoSessionTracking: true,
3940
integrations: [
4041
new Integrations.BrowserTracing(),
4142
],

0 commit comments

Comments
 (0)