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
docs(nextjs): Add vercel specific microfrontends guide (#15520)
Adds micro frontends guide specific to [vercel's microfrontends
feature](https://vercel.com/docs/microfrontends) since it has multi-zone
application support which doesn't require the use of module federation.
---------
Co-authored-by: Sarah Mischinger <[email protected]>
Vercel's multi-zone applications let you slice a large app into smaller, independently managed projects. Each project operates as its own application, with its own UI and tech stack. For example, you might use Next.js for one project, SvelteKit for another, and React for a third.
41
+
42
+
To set up Sentry in a multi-zone setup, configure Sentry separately within each project. Follow the installation steps for the framework each project uses. Here are a few examples:
In all cases `Sentry.init()` must never be called more than once, doing so
38
64
will result in undefined behavior.
39
65
</Alert>
40
66
67
+
</PlatformSection>
68
+
41
69
## Automatically Route Errors to Different Projects
42
70
43
71
`ModuleMetadata` and `makeMultiplexedTransport` can be used together to automatically route events to specific Sentry projects that represent your micro frontend services. Events will be routed once the service where the error occurred has been identified, ensuring errors are tracked in the correct project.
@@ -75,7 +103,8 @@ module.exports = {
75
103
```
76
104
77
105
<Alert>
78
-
**Replace `__MODULE_DSN__` with your actual Sentry project DSN.** You can find your DSN in your Sentry project settings under Client Keys (DSN).
106
+
**Replace `__MODULE_DSN__` with your actual Sentry project DSN.** You can find
107
+
your DSN in your Sentry project settings under Client Keys (DSN).
79
108
</Alert>
80
109
81
110
Once metadata has been injected into modules, the `moduleMetadataIntegration`
@@ -203,7 +232,9 @@ init({
203
232
```
204
233
205
234
<Alert>
206
-
**Replace `__DEFAULT_DSN__` with your actual Sentry project DSN.** This should be the DSN for your default/fallback Sentry project. You can find your DSN in your Sentry project settings under Client Keys (DSN).
235
+
**Replace `__DEFAULT_DSN__` with your actual Sentry project DSN.** This should
236
+
be the DSN for your default/fallback Sentry project. You can find your DSN in
237
+
your Sentry project settings under Client Keys (DSN).
207
238
</Alert>
208
239
209
240
Once this is set up, errors - both handled and unhandled - will be automatically routed to the right project.
@@ -257,7 +288,8 @@ init({
257
288
- Replace `__CART_DSN__` with the DSN for your cart micro frontend's Sentry project
258
289
- Replace `__GALLERY_DSN__` with the DSN for your gallery micro frontend's Sentry project
259
290
260
-
You can find your DSNs in each Sentry project's settings under Client Keys (DSN).
291
+
You can find your DSNs in each Sentry project's settings under Client Keys (DSN).
292
+
261
293
</Alert>
262
294
263
295
You can then set tags/contexts on events in individual micro-frontends to decide which Sentry project to send the event to as follows:
0 commit comments