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

NodeRequestAdapter

Extends:

IRequestAdapter → NodeRequestAdapter

The Node.js request adapter (Node.js only).

This IRequestAdapter uses an npm package called superagent (https://npmjs.org/package/superagent) to send requests to the PageProof API in a Node.js environment. It's recommended this adapter be used in cases like Electron (https://electron.atom.io) because it is not limited to the network constraints of browser renderers.

Note: This adapter does not yet support progress events.

Example:

import PageProof from '@pageproof/sdk';
import NodeRequestAdapter from '@pageproof/sdk/lib/adapters/NodeRequestAdapter';

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

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

Public Members

public options: * source

Public Methods

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

Override:

IRequestAdapter#send

Params:

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

Return:

*