Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

What SDK should we use for isomorphic JS #5805

Answered by AbhiPrasad
sacummings91 asked this question in Q&A
Discussion options

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/browser

SDK Version

7.13

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

I'm curious which SDK we should be using if we need Sentry on both the client & server but we don't use NextJS. Should we still use the Next SDK? I also saw there is an electron SDK that seems to support both browser and node. The existing closed issues seem to just be for Next users so any guidance on this would be appreciated.

Expected Result

1 Sentry library working on both client and server

Actual Result

Not sure which library to install

You must be logged in to vote

Hey! We recommend initializing two SDK instances, one for the server (@sentry/node) and one for the client (@sentry/browser). This is how the NextJS SDK and the Electron SDK works under the hood.

Replies: 2 comments 3 replies

Comment options

Hey! We recommend initializing two SDK instances, one for the server (@sentry/node) and one for the client (@sentry/browser). This is how the NextJS SDK and the Electron SDK works under the hood.

You must be logged in to vote
1 reply
Comment options

Hey @AbhiPrasad, thanks for letting me know!

Answer selected by sacummings91
Comment options

I just released npm package sentries which allows you to have one simple sentry package that works everywhere

You must be logged in to vote
2 replies
Comment options

Hey @remorses - I assume this works by using package.json exports? Unfortunately in some bundlers, deployment environments, and usages of certain Node.js loaders this doesn't work well. Cool project though! Feel free to blog or post on social media about it, we're more than happy to share it though Sentry's social media.

I recommend you follow the same versioning structure of the @sentry/X packages in isosentry so that users know exactly what sentry releases map to isosentry.

Comment options

Yes I am using exports, if you use modern bundlers and runtimes it should work pretty well, it's supported everywhere nowadays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #5804 on September 22, 2022 18:40.

AltStyle によって変換されたページ (->オリジナル) /