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.
To use the middleware on a specific route follow this example:
1
from perimeterx.middleware import PerimeterX
2
3
px_config = {
4
'px_app_id': 'PX_APP_ID',
5
'px_cookie_secret': 'PX_COOKIE_KEY',
6
'px_auth_token': 'PX_AUTH_TOKEN',
7
}
8
application = get_wsgi_application()
9
application = PerimeterX(application, px_config)
The Application ID / AppId and Token / Auth Token can be found in the Portal, in Applications.
HUMAN Risk Cookie / Cookie Secret can be found in the portal, in Policies.
The Policy from where the Risk Cookie / Cookie Secret is taken must correspond with the Application from where the Application ID / AppId and Token / Auth Token.
For details on how to create a custom Captcha page, refer to the documentation