Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 73 additions & 17 deletions docs/platforms/javascript/guides/ember/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@ categories:

<PlatformContent includePath="getting-started-prerequisites" />

## Step 1: Install
<StepConnector selector="h2" showNumbers={true}>

## Install

### Install the Sentry SDK

<SplitLayout>
<SplitSection>
<SplitSectionText>

Run the command for your preferred package manager to add the Sentry SDK to your application:

</SplitSectionText>
<SplitSectionCode>

<PlatformContent includePath="getting-started-install" />

## Step 2: Configure
</SplitSectionCode>
</SplitSection>
</SplitLayout>

## Configure

Choose the features you want to configure, and this guide will show you how:

Expand All @@ -35,8 +48,15 @@ Choose the features you want to configure, and this guide will show you how:

### Initialize the SDK

<SplitLayout>
<SplitSection>
<SplitSectionText>

Configuration should happen as early as possible in your application's lifecycle. Add the following to your `app/app.js` file:

</SplitSectionText>
<SplitSectionCode>

```javascript {filename:app.js}
import Application from "@ember/application";
import Resolver from "ember-resolver";
Expand Down Expand Up @@ -95,21 +115,34 @@ export default class App extends Application {
}
```

## Step 3: Add Readable Stack Traces With Source Maps (Optional)
</SplitSectionCode>
</SplitSection>
</SplitLayout>

### Add Readable Stack Traces With Source Maps (Optional)

<PlatformContent includePath="getting-started-sourcemaps-short-version" />
<PlatformContent includePath="getting-started-sourcemaps-short-version-splitlayout" />

## Step 4: Avoid Ad Blockers With Tunneling (Optional)
### Avoid Ad Blockers With Tunneling (Optional)

<PlatformContent includePath="getting-started-tunneling" />
<PlatformContent includePath="getting-started-tunneling-splitlayout" />

## Step 5: Verify Your Setup
## Verify Your Setup

Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.

### Issues

To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your templates, which will trigger an error that Sentry will capture when you click it:
<SplitLayout>
<SplitSection>
<SplitSectionText>

To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your templates, which will trigger an error that Sentry will capture when you click it.

<PlatformContent includePath="getting-started-browser-sandbox-warning" />

</SplitSectionText>
<SplitSectionCode>

```handlebars {filename: application.hbs}
{{! rest of your page }}
Expand All @@ -118,7 +151,19 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
</button>
```

Next, add the corresponding action to your controller or component:
</SplitSectionCode>
</SplitSection>
<SplitSection>
<SplitSectionText>

Next, add the corresponding action to your controller or component.

<OnboardingOption optionId="performance" hideForThisOption>
Open the page in a browser and click the button to trigger a frontend error.
</OnboardingOption>

</SplitSectionText>
<SplitSectionCode>

```javascript {filename: application.js}
import Controller from "@ember/controller";
Expand All @@ -132,15 +177,22 @@ export default class ApplicationController extends Controller {
}
```

<OnboardingOption optionId="performance" hideForThisOption>
Open the page in a browser and click the button to trigger a frontend error.
</OnboardingOption>

<PlatformContent includePath="getting-started-browser-sandbox-warning" />
</SplitSectionCode>
</SplitSection>
</SplitLayout>

<OnboardingOption optionId="performance">
### Tracing
To test your tracing configuration, update the previous code snippet to start a trace to measure the time it takes to execute your code:

<SplitLayout>
<SplitSection>
<SplitSectionText>

To test your tracing configuration, update the previous code snippet to start a trace to measure the time it takes to execute your code.
Then, open the page in a browser and click the button to trigger a frontend error and a trace.

</SplitSectionText>
<SplitSectionCode>

```javascript {filename: application.js} {3,8-12}
import Controller from "@ember/controller";
Expand All @@ -159,13 +211,15 @@ export default class ApplicationController extends Controller {
}
```

Open the page in a browser and click the button to trigger a frontend error and a trace.
</SplitSectionCode>
</SplitSection>
</SplitLayout>

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />
<Include name="logs/javascript-quick-start-verify-logs-splitlayout" />

</OnboardingOption>

Expand Down Expand Up @@ -193,3 +247,5 @@ Our next recommended steps for you are:
- [Get support](https://sentry.zendesk.com/hc/en-us/)

</Expandable>

</StepConnector>
105 changes: 83 additions & 22 deletions docs/platforms/javascript/guides/gatsby/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,26 @@ categories:

<PlatformContent includePath="getting-started-prerequisites" />

## Step 1: Install
<StepConnector selector="h2" showNumbers={true}>

## Install

### Install the Sentry SDK

Run the command for your preferred package manager to add the Sentry SDK to your application:
<SplitLayout>
<SplitSection>
<SplitSectionText>

Run the command for your preferred package manager to add the Sentry SDK to your application.

<Alert>

`@sentry/gatsby` is a wrapper around the `@sentry/react` package, with additional Gatsby-specific functionality. This means that you can import all methods available in the `@sentry/react` package from `@sentry/gatsby`.

</Alert>

</SplitSectionText>
<SplitSectionCode>

```bash {tabTitle:npm}
npm install @sentry/gatsby --save
Expand All @@ -27,16 +42,21 @@ yarn add @sentry/gatsby
pnpm add @sentry/gatsby
```

<Alert>

`@sentry/gatsby` is a wrapper around the `@sentry/react` package, with additional Gatsby-specific functionality. This means that you can import all methods available in the `@sentry/react` package from `@sentry/gatsby`.

</Alert>
</SplitSectionCode>
</SplitSection>
</SplitLayout>

### Register the Sentry SDK

<SplitLayout>
<SplitSection>
<SplitSectionText>

Register `@sentry/gatsby` in your Gatsby configuration file (typically `gatsby-config.(js|ts)`).

</SplitSectionText>
<SplitSectionCode>

```javascript {tabTitle: CommonJS}{filename:gatsby-config.(js|ts)}
module.exports = {
plugins: [
Expand All @@ -62,7 +82,11 @@ const config: GatsbyConfig = {
export default config;
```

## Step 2: Configure
</SplitSectionCode>
</SplitSection>
</SplitLayout>

## Configure

Choose the features you want to configure, and this guide will show you how:

Expand All @@ -80,8 +104,15 @@ Choose the features you want to configure, and this guide will show you how:

### Initialize the Sentry SDK

<SplitLayout>
<SplitSection>
<SplitSectionText>

Initialize Sentry as early as possible in your application. For this, create a new file `sentry.config.(js|ts)` in your project root and add the following:

</SplitSectionText>
<SplitSectionCode>

```javascript {filename:sentry.config.(js|ts)}
import * as Sentry from "@sentry/gatsby";

Expand Down Expand Up @@ -132,21 +163,39 @@ Sentry.init({
});
```

## Step 3: Add Readable Stack Traces With Source Maps (Optional)
</SplitSectionCode>
</SplitSection>
</SplitLayout>

### Add Readable Stack Traces With Source Maps (Optional)

<PlatformContent includePath="getting-started-sourcemaps-short-version" />
<PlatformContent includePath="getting-started-sourcemaps-short-version-splitlayout" />

## Step 4: Avoid Ad Blockers With Tunneling (Optional)
### Avoid Ad Blockers With Tunneling (Optional)

<PlatformContent includePath="getting-started-tunneling" />
<PlatformContent includePath="getting-started-tunneling-splitlayout" />

## Step 6: Verify Your Setup
## Verify Your Setup

Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.

### Issues

To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your pages:
<SplitLayout>
<SplitSection>
<SplitSectionText>

To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your pages.

<OnboardingOption optionId="performance" hideForThisOption>
Then, open the page in a browser and click the button to trigger a frontend
error.
</OnboardingOption>

<PlatformContent includePath="getting-started-browser-sandbox-warning" />

</SplitSectionText>
<SplitSectionCode>

```javascript {filename:index.(jsx|tsx)}
<button
Expand All @@ -159,15 +208,23 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
</button>
```

<OnboardingOption optionId="performance" hideForThisOption>
Open the page in a browser and click the button to trigger a frontend error.
</OnboardingOption>

<PlatformContent includePath="getting-started-browser-sandbox-warning" />
</SplitSectionCode>
</SplitSection>
</SplitLayout>

<OnboardingOption optionId="performance">
### Tracing
To test your tracing configuration, update the previous code snippet and wrap the error in a custom span:

<SplitLayout>
<SplitSection>
<SplitSectionText>

To test your tracing configuration, update the previous code snippet and wrap the error in a custom span.

Then, open the page in a browser and click the button to trigger a frontend error and trace.

</SplitSectionText>
<SplitSectionCode>

```javascript {filename:index.(jsx|tsx)}
<button
Expand All @@ -182,13 +239,15 @@ To test your tracing configuration, update the previous code snippet and wrap th
</button>
```

Open the page in a browser and click the button to trigger a frontend error and trace.
</SplitSectionCode>
</SplitSection>
</SplitLayout>

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />
<Include name="logs/javascript-quick-start-verify-logs-splitlayout" />

</OnboardingOption>

Expand All @@ -214,3 +273,5 @@ Now's a good time to customize your setup and look into more advanced topics. Ou
- [Get support](https://sentry.zendesk.com/hc/en-us/)

</Expandable>

</StepConnector>
Loading
Loading