Skip to content

Commit fd86c26

Browse files
committed
ref(js): Add section about version alignment to Micro Frontends documentation
1 parent 940bbe9 commit fd86c26

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/platforms/javascript/common/best-practices/micro-frontends.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,21 @@ captureException(new Error("oh no!"), (scope) => {
192192
return scope;
193193
});
194194
```
195+
196+
## SDK Version Alignment
197+
198+
Since version 8 of the Sentry JavaScript SDKs, multiple SDKs on the same page will [only interact with each other](https://github.com/getsentry/sentry-javascript/pull/12206) if they're aligned to the same version.
199+
This was done with the objective to prevent cross-SDK interactions in unwanted scenarios, like browser extensions or 3rd party scripts using Sentry and
200+
interfering with SDKs on the same page.
201+
202+
However, for micro frontends, where you specifically _want_ SDK interaction between multiple SDKs, you need to ensure that all SDKs are aligned to the same version.
203+
204+
An example where version alignment is important is when you initialize the SDK once in a host or skeleton application but use Sentry SDK calls in micro frontend child applications.
205+
For example, if your individual micro frontends call `Sentry.captureException`.
206+
207+
<Note>
208+
209+
If you cannot guarantee version alignment, you can [follow this workaround](https://github.com/getsentry/sentry-javascript/discussions/10576#discussioncomment-11446422).
210+
In this case, we cannot guarantee perfect interoperability between SDKs, meaning you might run into unexpected behavior.
211+
212+
</Note>

0 commit comments

Comments
 (0)