For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
      • AWS Lambda@Edge changelog
        • Installation
        • Manual installation
        • API
        • Configuration
        • Upgrading
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
On this page
  • createHumanEnforceHandler()
  • createHumanFirstPartyHandler()
  • createHumanActivitiesHandler()
  • HumanSecurityEnforcer
  • HumanSecurityEnforcer.initialize()
  • enforce()
  • HumanSecurityFirstParty
  • HumanSecurityFirstParty.initialize()
  • handleFirstParty()
  • HumanSecurityPostEnforcer
  • HumanSecurityPostEnforcer.initialize()
  • postEnforce()
Enforcer frameworksAWS Lambda@EdgeV4

API

Was this page helpful?
Previous

Configuration

Next
Built with

createHumanEnforceHandler()

A function that creates an out-of-the box CloudFront request handler with the HumanSecurityEnforcer already integrated into it.

1createHumanEnforceHandler(config: HumanSecurityConfiguration) => CloudFrontRequestHandler
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a CloudFrontRequestHandler function in the form of (event: CloudFrontRequestEvent, context: Context) => Promise<CloudFrontRequest | CloudFrontResponseResult>

createHumanFirstPartyHandler()

A function that creates an out-of-the box CloudFront request handler for first party requests.

1createHumanFirstPartyHandler(config: MarkOptional<HumanSecurityConfiguration, 'px_auth_token' | 'px_cookie_secret'>) => CloudFrontRequestHandler
  • Parameters
    • config: HumanSecurityConfiguration (except that the px_auth_token and px_cookie_secret configurations are optional)
  • Returns a CloudFrontRequestHandler in the form of (event: CloudFrontRequestEvent, context: Context) => Promise<CloudFrontRequest | CloudFrontResponseResult>

createHumanActivitiesHandler()

A function that creates an out-of-the box CloudFront response handler with the HumanSecurityPostEnforcer already integrated into it.

1createHumanActivitiesHandler(config: HumanSecurityConfiguration) => CloudFrontResponseHandler
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a CloudFrontResponseHandler in the form of (event: CloudFrontResponseEvent, context: Context) => Promise<CloudFrontResponseResult>

HumanSecurityEnforcer

The entity responsible for performing HUMAN enforcement at the viewer-request or origin-request event.

HumanSecurityEnforcer.initialize()

A static function that creates a new instance of the HumanSecurityEnforcer class from a HumanSecurityConfiguration object.

1HumanSecurityEnforcer.initialize(config: HumanSecurityConfiguration) => HumanSecurityEnforcer
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a new instance of the HumanSecurityEnforcer

enforce()

Executes the enforcement functionality, returning either a CloudFront response or null depending on which action should be taken.

1enforce(request: CloudFrontRequest, context?: Context) => Promise<CloudFrontResultResponse | null>
  • Parameters
    • request: CloudFrontRequest
    • context?: Context
  • Returns a Promise resolving to an CloudFrontResponseResult or null.

The second parameter, context, was added as an optional parameter in version 4.2.0.

HumanSecurityFirstParty

The HumanSecurityFirstParty class was added in version 4.3.0.

The entity responsible for handling HUMAN first party requests at the origin-request event.

HumanSecurityFirstParty.initialize()

A static function that creates a new instance of the HumanSecurityFirstParty class from a HumanSecurityConfiguration object.

1HumanSecurityFirstParty.initialize(config: HumanSecurityConfiguration) => HumanSecurityFirstParty
  • Parameters
    • config: HumanSecurityConfiguration (except that the px_auth_token and px_cookie_secret configurations are optional)
  • Returns a new instance of the HumanSecurityFirstParty

handleFirstParty()

Executes the first party functionality, returning a CloudFront request, a CloudFront response, or null depending on which action should be taken by the handler.

If a request or response are returned, then the incoming request has been identified as a first party request, and the resulting value should be returned from the handler. If the resulting value is null, then the incoming request is not a first party request.

1handleFirstParty(request: CloudFrontRequest, context?: Context) => Promise<CloudFrontRequest | CloudFrontResultResponse | null>
  • Parameters
    • request: CloudFrontRequest
    • context?: Context
  • Returns a Promise resolving to a CloudFrontRequest, CloudFrontResponseResult, or null.

HumanSecurityPostEnforcer

The entity responsible for performing HUMAN post-enforcement at the origin-response event.

HumanSecurityPostEnforcer.initialize()

A static function that creates a new instance of the HumanSecurityPostEnforcer class from a HumanSecurityConfiguration object.

1HumanSecurityPostEnforcer.initialize(config: HumanSecurityConfiguration) => HumanSecurityPostEnforcer
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a new instance of the HumanSecurityPostEnforcer

postEnforce()

Performs any post-enforcement processing actions such as sending HUMAN data to the collector.

1postEnforce(request: CloudFrontRequest, response: CloudFrontResponse) => `Promise<void>`
  • Parameters
    • request: CloudFrontRequest
    • response: CloudFrontResponse
  • Returns Promise<void>.