Add header values in the TypeScript PDF Viewer
16 Feb 20261 minute to read
Use the ajaxHeaders property inside the PDF Viewer’s ajaxRequestSettings to send custom HTTP headers with each request made by the viewer.
Example: Add a custom Authorization header using ajaxRequestSettings in an TypeScript component
viewer.ajaxRequestSettings = {
ajaxHeaders: [
{
headerName: "Authorization",
headerValue: "Bearer 64565dfgfdsjweiuvbiuyhiueygf"
}
],
withCredentials: false
};Sample: How to add custom headers using ajaxRequestSettings
StackBlitz example