Home Manual Reference Source
import XHRRequestAdapter from '@pageproof/sdk/src/adapters/XHRRequestAdapter.js'
public class | source

XHRRequestAdapter

Extends:

IRequestAdapter → XHRRequestAdapter

The XMLHttpRequest request adapter (browsers only).

Unlike other IRequestAdapters, this one has an option for async. By default the async option is enabled by default, to prevent multiple requests from blocking eachother.

Example:

import PageProof from '@pageproof/sdk';
import XHRRequestAdapter from '@pageproof/sdk/lib/xhr-request-adapter';

const client = new PageProof({
  adapters: [
    new XHRRequestAdapter({
      applicationId: '3uQkbQXsinffvnNHPlplx4Uw1sVeWEab',
      endpoint: 'https://managed-api.pageproof.com',
      key: '104882dfa7c44330811612ea100dc7e6',
      async: true,
    }),
  ],
});

Constructor Summary

Public Constructor
public

constructor(options: object)

Member Summary

Public Members
public

options: *

Method Summary

Public Methods
public

send(request: *, options: {}): *

Inherited Summary

From class IRequestAdapter
public abstract

send()

Public Constructors

public constructor(options: object) source

Params:

NameTypeAttributeDescription
options object
options.applicationId string

The application identifier (32 characters)

options.endpoint string

The endpoint to send API requests to

options.key string
  • optional

The subscription key

options.async boolean
  • optional
  • default: true

Whether to send request asynchronously

Public Members

public options: * source

Public Methods

public send(request: *, options: {}): * source

Override:

IRequestAdapter#send

Params:

NameTypeAttributeDescription
request *
options {}
  • optional
  • default: {}

Return:

*