PHPackages                             safefingerprint/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. safefingerprint/core

ActiveLibrary[Security](/categories/security)

safefingerprint/core
====================

Advanced PHP library for visitor fingerprinting, bot detection, and behavior analysis

101PHP

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/im-syn/SafeFingerPrint)[ Packagist](https://packagist.org/packages/safefingerprint/core)[ RSS](/packages/safefingerprint-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SafeFingerPrint Library Documentation
=====================================

[](#safefingerprint-library-documentation)

[![PHP Version](https://camo.githubusercontent.com/c3362351d1264fd924675776c4f8307bf5f229fa15cbbd49d020909278dadb3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e342d626c7565)](https://camo.githubusercontent.com/c3362351d1264fd924675776c4f8307bf5f229fa15cbbd49d020909278dadb3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e342d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)[![Build Status](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)

Introduction
------------

[](#introduction)

SafeFingerPrint is a powerful PHP library for advanced visitor tracking, bot detection, and behavior analysis. It provides comprehensive fingerprinting capabilities with sophisticated behavior detection algorithms to help protect your web applications from automated threats while maintaining legitimate user access.

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Basic Usage](#basic-usage)
- [Advanced Features](#advanced-features)
- [Security Features](#security-features)
- [Behavior Analysis](#behavior-analysis)
- [API Reference](#api-reference)
- [Troubleshooting](#troubleshooting)
- [Best Practices](#best-practices)

### Key Features

[](#key-features)

- Advanced Browser Fingerprinting
- Sophisticated Behavior Analysis
- Bot Detection
- IP Intelligence
- Customizable Security Rules
- Real-time Monitoring
- Detailed Analytics
- Privacy-Compliant Implementation

Installation
------------

[](#installation)

You can install SafeFingerPrint using Composer:

```
composer require safefingerprint/core
```

Or by cloning the repository:

```
git clone https://github.com/im-syn/SafeFingerPrint.git
cd SafeFingerPrint
composer install
```

### Requirements

[](#requirements)

Make sure your environment meets these requirements:

- PHP &gt;= 7.4
- ext-json: The JSON extension for PHP
- ext-pdo: The PDO extension for MySQL storage
- Write permissions for the logs directory

### Composer Configuration

[](#composer-configuration)

The `composer.json` configuration:

```
{
    "name": "safefingerprint/core",
    "description": "Advanced PHP library for visitor fingerprinting, bot detection, and behavior analysis",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "SafeFingerPrint"
        }
    ],
    "minimum-stability": "stable",
    "require": {
        "php": ">=7.4",
        "ext-json": "*",
        "ext-pdo": "*"
    },
    "require-dev": {
        "phpunit/phpunit": "^9.5"
    },
    "autoload": {
        "psr-4": {
            "SafeFingerPrint\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "SafeFingerPrint\\Tests\\": "tests/"
        }
    }
}
```

> 💡 **Tip:** After installation, make sure your web server has write permissions for the logs directory.

Storage Options
---------------

[](#storage-options)

SafeFingerPrint supports multiple storage backends:

1. **JSON File Storage** (default)

    - Stores data in JSON files
    - Simple setup, no database required
    - Good for small to medium sites
2. **MySQL Storage**

    - Stores data in MySQL database
    - Better for high-traffic sites
    - Supports complex queries and analytics
3. **Session Storage**

    - Stores data only in PHP session
    - No persistent storage
    - Perfect for privacy-focused implementations

### Quick Start

[](#quick-start)

Here's a minimal example using JSON storage:

```
