> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Configuration Options

## Configuring Required Parameters

Configuration options are set on the `$perimeterxConfig` variable.

### Required parameters:

* app\_id
* cookie\_key
* auth\_token
* module\_mode

All parameters are obtainable via the HUMAN Portal. (Applications and Policies pages)

### Changing the Minimum Score for Blocking

**Default blocking value:** 100

```php
$perimeterxConfig = [
    ..
    'blocking_score' => 75
    ..
]
```

### Custom Blocking Actions

In order to customize the action performed on a valid block value, use the 'custom\_block\_handler' option, and provide a user-defined function.

The custom handler should contain the action to be taken, when a visitor receives a score higher than the 'blocking\_score' value.\
A common customization option can be supplying a custom branded block page.

**Default block behaviour:** return an HTTP status code of 403 and serve the HUMAN block page.

```php
/**
 * @param \Perimeterx\PerimeterxContext $pxCtx
 */
$perimeterxConfig['custom_block_handler'] = function ($pxCtx)
{
    $block_score = $pxCtx->getScore();
    $block_uuid = $pxCtx->getUuid();

    // user defined logic goes here
};

$px = Perimeterx::Instance($perimeterxConfig);
$px->pxVerify();
```

##### Examples

**Serving a Custom HTML Page**

```php
/**
 * @param \Perimeterx\PerimeterxContext $pxCtx
 */
$perimeterxConfig['custom_block_handler'] = function ($pxCtx)
{
    $block_score = $pxCtx->getScore();
    $block_uuid = $pxCtx->getUuid();
    $full_url = $pxCtx->getFullUrl();

    $html = '<div>Access to ' . $full_url . ' has been blocked.</div> ' +
                  '<div>Block reference - ' . $block_uuid . ' </div> ' +
                  '<div>Block score - ' . $block_score . '</div>';

    //echo $html;
    header("Status: 403");
    die();
};

$px = Perimeterx::Instance($perimeterxConfig);
$px->pxVerify();
```