Migrating Custom Transports to latest (7.x) SDK version #7112
-
Hello people, We are trying to upgrade our self-hosted Sentry server and clients to latest versions.
which makes the Now I am not sure what we should pass to that argument, and I cannot seem to find any related documentation. Any help would be appreciated, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey @ktsangop - you shouldn't need to access those internal base transport options. Something like so should suffice: /**
* Creates a Custom transport.
*/
export function makeCustomTransport(
options: BrowserTransportOptions,
): Transport {
async function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {
try {
const response = await makeARequestFromUrl(options.url, request.body);
// the `statusCode` and the two rate limiting headers
const transportResponse = {
statusCode: response.status,
headers: {
'x-sentry-rate-limits': response.header['X-Sentry-Rate-Limits'],
'retry-after': response.headers['Retry-After'],
},
};
return Promise.resolve(transportResponse)
} catch (e) {
clearCachedFetchImplementation();
return rejectedSyncPromise(e);
}
}
return createTransport(options, makeRequest);
} |
Beta Was this translation helpful? Give feedback.
Hey @ktsangop - you shouldn't need to access those internal base transport options.
Something like so should suffice: