If you’re upgrading from version 7.x or below of the Node Express, many of the configuration fields have remained the same.
The following configuration fields have been modified:
px_additional_activity_handler has been changed. The function signature has been modified from (pxCtx, config) => void to (config, context, request) => Promise<void> | void.px_enrich_custom_parameters has been changed. The function signature has been modified from (customParams, request) => CustomParameters to (config, request) => Promise<CustomParameters>.px_cors_custom_preflight_handler has been changed. The function signature has been modified from (request) => Response to (request) => Promise<{ body: string, headers: Record<string, string[]>, status: number }>.px_cors_create_custom_block_response_headers has been changed. The function signature modified from (request) => Promise<Record<string, string>> to (request) => Promise<Record<string, string[]>>.The following configuration fields have been removed:
px_custom_request_handlerpx_extract_user_ippx_send_async_activities_enabledpx_dynamic_configuration_enabledpx_cd_first_party_enabledpx_testing_mode_enabledpx_custom_template_rootpx_pxhd_secure_enabledpx_proxy_urlpx_modify_contextIn prior versions of the Node Express Enforcer:
perimeterx-node-express packageperimeterx.init()perimeterx.middleware propertySee the code sample below for the v7.x integration.
While the same basic principles of importing, initializing, and accessing the middleware still hold true in the new version of the enforcer, they are done in a slightly different way.
@humansecurity/node-express-enforcer package. Note that the perimeterx-node-express package is considered deprecated.createHumanSecurityHandler()createHumanSecurityHandler()