feat: Add Sidecar connect function#92
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Is there any reason we cant automatically do this somehow? |
|
Also lets open a ticket on the core JS repo to make sure whatever we do here becomes a native API |
|
Only to avoid the SDK even knowing about Spotlight/Sidecar fetch("http://localhost:8969/stream", {
method: "POST",
body: serializeEnvelope(envelope),
headers: {
"Content-Type": "application/x-sentry-envelope",
},
mode: "cors",
}).catch((err) => {
console.error('[Spotlight]', err);
});This is only a problem for Node (and other Server SDKs) - not for Browser |
|
The advantage of an explicit I think initially this is fine until this all is a bit more robust. |
| "./vite-plugin": { | ||
| "import": "./src/vite-plugin.js" | ||
| }, | ||
| "./connect": { |
There was a problem hiding this comment.
is there no other sane way to define these main exports e.g. in like an index.ts or something?
|
We should reconsider this and put a spotlight: true/false into Sentry.init() in SDKs imo. |
To hook into Sentry's Node SDK this is what you have to do:
ref: #76