Skip to content

Conversation

@rbaradari
Copy link

Why

Currently, the Faro Web SDK only allows to configure static headers for transport requests.

When sending data through a proxy it might require a valid authentication token (e.g. JWT). Since tokens can expire and need to be refreshed, we need a way to lookup dynamic header values for each request.

What

Extended the RequestOptions headers to also support callback functions that return a header value. This change is implemented for the Fetch transport and to stay aligned also for the OLTP HTTP transport.

I've not opted to also implement a Promise based asynchronous lookup. That would have significantly increased the change set. It is expected that any token refreshes are done by the application. When building requests by Faro we can directly lookup the currently available token.

Links

Addresses feature request #1490.

Checklist

  • Tests added
  • Changelog updated
  • Documentation updated

@CLAassistant
Copy link

CLAassistant commented Nov 23, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ramin Baradari seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rbaradari rbaradari force-pushed the dynamic-headers-in-transport branch from 215f961 to d9e6550 Compare November 28, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants