Any way to reuse default transports but with dynamic request data #6303
Unanswered
OrkhanAlikhanov
asked this question in
Q&A
Replies: 3 comments 3 replies
|
You can do something similar to #6211 (comment), but then add the following logic: const transport = supportsFetch() ? makeFetchTransport(transportOptions) : makeXHRTransport(transportOptions); |
0 replies
|
@AbhiPrasad thanks for the answer but |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello, we have to send sentry events/traces to the different endpoints in a specific format which dumps those the events to kafka where we pick up them, reconstruct a proper valid envelope payload and post to internal sentry. I know that we can create custom transports for that but that's a pain considering there are a lot of good stuff in
createTransport,makeFetchTransport, andmakeXHRTransportthat we'll have to copy over, just to change the payload format and url/headers. Would be great if we could something like this:Basically
getRequestcallback is called with certain payload and return value (url, body, and headers) is passed down to the underlaying transport (fetch/xhr in this case). What do you think?All reactions