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: docs/platforms/javascript/guides/aws-lambda/install/layer.mdx
+12-27Lines changed: 12 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: "Learn how to add the Sentry Node Lambda Layer to use Sentry in you
4
4
sidebar_order: 1
5
5
---
6
6
7
-
The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding`@sentry/aws-serverless` with `npm` or `yarn` manually.
7
+
The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of installing`@sentry/aws-serverless` with a package manager manually.
8
8
If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code.
9
9
10
10
## Prerequisites
@@ -60,7 +60,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori
60
60
Set the following environment variables in your Lambda function configuration:
Instead of using environment variables, you can manually initialize the SDK and wrap your handler in code. This approach works for both CommonJS and ESM functions and allows for further customization of the SDK setup.
95
99
96
100
Note that you don't have to actually install an NPM package for this to work, as the package is already included in the Lambda Layer.
It's important to add both, the `Sentry.init` call outside the handler function and the `Sentry.wrapHandler` wrapper around your function to automatically catch errors and performance data.
131
+
It's important to add both, the `Sentry.init` call outside the handler function and the `Sentry.wrapHandler` wrapper around your function to automatically catch errors and performance data. Make sure that the `Sentry.init` call and the import statement are at the very top of your file before any other imports.
136
132
137
-
#### For ESM Functions
133
+
#### For ESM Lambda Functions
138
134
139
135
First, wrap your handler:
140
136
@@ -152,20 +148,13 @@ Create a new file, for example `instrument.mjs` to initialize the SDK:
Copy file name to clipboardExpand all lines: docs/platforms/javascript/guides/aws-lambda/install/npm.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for
8
8
We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function.
9
9
If you need more control over the SDK setup, you can also [initialize the SDK in code](#option-b-manual-setup).
10
10
11
-
However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](../layer) instead.
11
+
However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](../layer) instead.
12
12
13
13
## 1. Prerequisites
14
14
@@ -85,7 +85,7 @@ Choose your setup method based on your Lambda function type:
85
85
Set the following environment variables in your Lambda function configuration:
0 commit comments