Skip to content

feat: Update node getting started pages #10164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2024
Merged
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
59 changes: 1 addition & 58 deletions docs/platforms/javascript/guides/connect/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,4 @@ categories:

This guide explains how to set up Sentry in your Connect application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>
This guide is for version 8.0.0 and up of `@sentry/node`.
</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

<Alert level="warning" title="Running with ESM">

If you run your application with ESM, you need to import the Sentry Initialization file before importing any other modules. See <PlatformLink to="/install/esm">running Sentry with ESM</PlatformLink>.
If you are unsure how you are running your application, see <PlatformLink to="/install">Installation Methods</PlatformLink> for more information.

</Alert>

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
59 changes: 1 addition & 58 deletions docs/platforms/javascript/guides/express/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,4 @@ categories:

This guide explains how to set up Sentry in your Express application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>This guide is for version 8.0.0 and up of `@sentry/node`.</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

Once this is done, Sentry's Node SDK captures unhandled exceptions as well as tracing data for your application.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

<Alert level="warning" title="Running with ESM">

If you run your application with ESM, you need to import the Sentry Initialization file before importing any other modules. See <PlatformLink to="/install/esm">running Sentry with ESM</PlatformLink>.
If you are unsure how you are running your application, see <PlatformLink to="/install">Installation Methods</PlatformLink> for more information.

</Alert>

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
59 changes: 1 addition & 58 deletions docs/platforms/javascript/guides/fastify/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,4 @@ categories:

This guide explains how to set up Sentry in your Fastify application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>This guide is for version 8.0.0 and up of `@sentry/node`.</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

Once this is done, Sentry's Node SDK captures unhandled exceptions as well as tracing data for your application.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

<Alert level="warning" title="Running with ESM">

If you run your application with ESM, you need to import the Sentry Initialization file before importing any other modules. See <PlatformLink to="/install/esm">running Sentry with ESM</PlatformLink>.
If you are unsure how you are running your application, see <PlatformLink to="/install">Installation Methods</PlatformLink> for more information.

</Alert>

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
61 changes: 1 addition & 60 deletions docs/platforms/javascript/guides/hapi/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,4 @@ categories:

This guide explains how to set up Sentry in your Hapi application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>
This guide is for version 8.0.0 and up of `@sentry/node`.
</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

Once this is done, Sentry's Node SDK captures unhandled exceptions as well as tracing data for your application.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

<Alert level="warning" title="Running with ESM">

If you run your application with ESM, you need to import the Sentry Initialization file before importing any other modules. See <PlatformLink to="/install/esm">running Sentry with ESM</PlatformLink>.
If you are unsure how you are running your application, see <PlatformLink to="/install">Installation Methods</PlatformLink> for more information.

</Alert>

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
61 changes: 1 addition & 60 deletions docs/platforms/javascript/guides/koa/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,4 @@ categories:

This guide explains how to set up Sentry in your Koa application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>
This guide is for version 8.0.0 and up of `@sentry/node`.
</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

Once this is done, Sentry's Node SDK captures unhandled exceptions as well as tracing data for your application.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

<Alert level="warning" title="Running with ESM">

If you run your application with ESM, you need to import the Sentry Initialization file before importing any other modules. See <PlatformLink to="/install/esm">running Sentry with ESM</PlatformLink>.
If you are unsure how you are running your application, see <PlatformLink to="/install">Installation Methods</PlatformLink> for more information.

</Alert>

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
54 changes: 1 addition & 53 deletions docs/platforms/javascript/guides/nestjs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,4 @@ categories:

This guide explains how to set up Sentry in your Nest.js application.

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.

<Note>
This guide is for version 8.0.0 and up of `@sentry/node`.
</Note>

## Install

Sentry captures data by using an SDK within your application’s runtime. This means that you have to add `@sentry/node` as a runtime dependency to your application:

```bash {tabTitle:npm}
npm install --save @sentry/node
```

```bash {tabTitle:Yarn}
yarn add @sentry/node
```

## Configure

Sentry should be initialized as early in your app as possible. It is essential that you call `Sentry.init` before you require any other modules in your application—otherwise, auto-instrumentation of these modules will _not_ work.

Once this is done, Sentry's Node SDK captures unhandled exceptions as well as tracing data for your application.

You need to create a file named `instrument.js` that imports and initializes Sentry:

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

If you set a `tracesSampleRate`, performance instrumentation will automatically be enabled for you. See <PlatformLink to="/performance/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.

You can also manually capture performance data - see <PlatformLink to="/performance/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> for details.

## Use

You need to require or import the `instrument.js` file before requiring any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:

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

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

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

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

<Note>

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.

</Note>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
<PlatformContent includePath="getting-started-node" />
Loading
Loading