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
You can also define these values as environment variables in e.g. a `.env` file
74
+
or in you CI configuration:
75
+
76
+
```sh
77
+
SENTRY_ORG="your-org-slug"
78
+
SENTRY_PROJECT="your-project"
79
+
SENTRY_AUTH_TOKEN="your-token"
80
+
```
81
+
82
+
### 3. [Optional] Advanced Configuration
83
+
84
+
To fully customize and configure Sentry in an Astro project, follow step 1 and in addition,
85
+
add a `sentry.client.config.(js|ts)` and `sentry.server.config(js|ts)` file to the root directory of your project.
86
+
Inside these files, you can call `Sentry.init()` and get the full range of Sentry options.
87
+
88
+
Configuring the client SDK:
89
+
90
+
```js
91
+
// sentry.client.config.ts or sentry.server.config.ts
92
+
import*asSentryfrom"@sentry/astro";
93
+
94
+
Sentry.init({
95
+
dsn:"__DSN__",
96
+
beforeSend(event) {
97
+
console.log("Sending event on the client");
98
+
returnevent;
99
+
},
100
+
tracesSampler: () => {/* ... */}
101
+
});
102
+
```
103
+
104
+
**Important**: Once you created a sentry config file, the SDK options passed to `sentryAstro` will be ignored for the respective runtime. You can also only define create of the two files.
105
+
106
+
#### 3.1 Custom file location
107
+
108
+
If you want to move the `sentry.*.config` files to another location,
109
+
you can specify the file path, relative to the project root, in `sentryAstro`:
0 commit comments