Skip to content

Migrating Custom Transports to latest (7.x) SDK version #7112

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

You must be logged in to vote

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

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ktsangop
Comment options

@AbhiPrasad
Comment options

@ktsangop
Comment options

@AbhiPrasad
Comment options

@AbhiPrasad
Comment options

Answer selected by ktsangop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants