Sentry api calls via an api gateway

Hello there,
First of all, a big thanks to the team and community members for the tool itself and the support you all provide to each of us.

So, I am facing a situation in my on-premise setup where i can’t communicate to the sentry server directly from my application servers, and all traffic needs to go via a gateway(gw) which validates the request, before forwarding it upstream.
The gateway expects a custom auth key to be sent along, to do above.

How we are trying to do it currently, is to map the underlying apis on gw, send request from apps to gw with our header, which will then be forwarded to sentry server itself.
So for eg, the store api below will be available on gw host, and will be translated to sentry host -


To achieve this, the easiest way that we could think of is to modify the client sdk to add extra headers, as i couldn’t find (maybe there is) a way to add custom headers.
We are still working on some communications setup but i believe it should work.
So, need feedback if there is a simpler way to do above.

Second part, we are also leveraging the sentry-cli to feed sourcemaps and releases via our build pipelines to sentry. But again, even the build server needs to go via gw to reach sentry.
Now, not being a pro in rust language, from reading the basics and doing some exploration, i managed to add a custom header here, where the request is being created and finally was able to build the executable using cargo.
Again, is this correct and the only way or there is a much more simpler way to do the same?
Also, is there a built in script to publish this as npm package, as i dont see one in the repos package.json

Appreciate any/ all inputs on above.