cloakings/cloakings-cloakit

Cloakings CloakIT Client

1.1.0 2024-06-26 16:01 UTC

This package is auto-updated.

Last update: 2024-11-26 16:47:21 UTC


README

Detect if user is bot or real user using cloakit.pro

Install

composer require cloakings/cloakings-cloakit

Usage

Basic Usage

Register at https://cloakit.pro. Create campaign:

  • Link to the target page: real.php
  • Link for bots: fake.php

Click "download code" for plain PHP or Wordpress and look for:

  • clientId
  • clientCompany
  • clientSecret
$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
$cloaker = \Cloakings\CloakingsCloakIt\CloakItCloaker(
    companyId: $companyId,
);
$cloakerResult = $cloaker->handle($request);

Check if result mode is CloakModeEnum::Fake or CloakModeEnum::Real and do something with it.

If you want to render result like the original CloakIT library

$baseIncludeDir = __DIR__; // change to your dir with real.php and fake.php
$renderer = \Cloakings\CloakingsCloakIt\CloakItRenderer();
$response = $renderer->render($cloakerResult);

Original Logic

Original library is located at doc/original.

License for this repository doesn't cover that code.