Skip to content

Attaching custom HTTP header to the requests sent to collector from web SDK? #726

Answered by codecapitano
Ketec asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Ketec

The option is a bit hidden.

To attach custom headers you need to instantiate Faro's FetchTrasnsport / OtlpHttpTRansport

initializeFaro({
    // ...
    transports: [
      new FetchTransport({
        url: 'my-collector-url/collect',
        requestOptions: {
          headers: {
            'x-foo': 'application/json',
          },
        },
      }),
    ],
   // ...
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by codecapitano
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