@@ -57,6 +57,8 @@ export interface OutQueue {
5757 * @param maxLocalStorageQueueSize - Maximum number of queued events we will attempt to store in local storage
5858 * @param connectionTimeout - Defines how long to wait before aborting the request
5959 * @param anonymousTracking - Defines whether to set the SP-Anonymous header for anonymous tracking on GET and POST
60+ * @param customHeaders - Allows custom headers to be defined and passed on XMLHttpRequest requests
61+ * @param withCredentials - Sets the value of the withCredentials flag on XMLHttpRequest (GET and POST) requests
6062 * @returns object OutQueueManager instance
6163 */
6264export function OutQueueManager (
@@ -71,7 +73,8 @@ export function OutQueueManager(
7173 maxLocalStorageQueueSize : number ,
7274 connectionTimeout : number ,
7375 anonymousTracking : boolean ,
74- customHeaders : Record < string , string >
76+ customHeaders : Record < string , string > ,
77+ withCredentials : boolean
7578) : OutQueue {
7679 type PostEvent = {
7780 evt : Record < string , unknown > ;
@@ -405,7 +408,7 @@ export function OutQueueManager(
405408 } else {
406409 xhr . open ( 'GET' , url , ! sync ) ;
407410 }
408- xhr . withCredentials = true ;
411+ xhr . withCredentials = withCredentials ;
409412 if ( anonymousTracking ) {
410413 xhr . setRequestHeader ( 'SP-Anonymous' , '*' ) ;
411414 }
0 commit comments