PHPackages                             droplog/droplog - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. droplog/droplog

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

droplog/droplog
===============

Official PHP SDK for Droplog — audit log infrastructure for SaaS

v0.1.2(1mo ago)00MITPHPPHP &gt;=8.1

Since Apr 19Pushed 1mo agoCompare

[ Source](https://github.com/droplog/droplog-php)[ Packagist](https://packagist.org/packages/droplog/droplog)[ Docs](https://droplog.dev)[ RSS](/packages/droplog-droplog/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Droplog PHP SDK
===============

[](#droplog-php-sdk)

Official PHP SDK for [Droplog](https://droplog.dev) — audit log infrastructure for SaaS.

Requirements
------------

[](#requirements)

- PHP 8.1+
- `ext-curl`
- `ext-json`

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

[](#installation)

```
composer require droplog/droplog
```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

```
use Droplog\Droplog;

$droplog = new Droplog('sk_live_ca_...');

// Or via environment variable DROPLOG_API_KEY
$droplog = new Droplog();
```

Options:

```
$droplog = new Droplog('sk_live_ca_...', [
    'base_url' => 'https://api.droplog.dev', // default
    'timeout'  => 30,                         // seconds, default 30
]);
```

### Track an event

[](#track-an-event)

```
$event = $droplog->track([
    'tenant_id' => 'tenant_123',
    'actor'     => [
        'id'    => 'usr_456',
        'name'  => 'Alice Dupont',
        'email' => 'alice@example.com',
        'role'  => 'admin',
    ],
    'action'   => 'document.created',
    'resource' => [
        'id'   => 'doc_789',
        'type' => 'document',
        'name' => 'Q1 Report',
    ],
    'metadata' => ['size_kb' => 42],
]);
```

### Track multiple events (batch)

[](#track-multiple-events-batch)

```
$result = $droplog->trackBatch([
    [
        'tenant_id' => 'tenant_123',
        'actor'     => ['id' => 'usr_456'],
        'action'    => 'user.login',
    ],
    [
        'tenant_id' => 'tenant_123',
        'actor'     => ['id' => 'usr_456'],
        'action'    => 'document.deleted',
        'resource'  => ['id' => 'doc_001', 'type' => 'document'],
    ],
]);

// $result['data']  — array of created events
// $result['total'] — count
```

### List events

[](#list-events)

```
$page = $droplog->events->list([
    'tenant_id' => 'tenant_123',
    'action'    => 'user.*',
    'limit'     => 20,
    'offset'    => 0,
]);

// $page['data']   — array of events
// $page['total']  — total matching events
// $page['limit']  — applied limit
// $page['offset'] — applied offset
```

### Get a single event

[](#get-a-single-event)

```
$event = $droplog->events->get('evt_...');
```

### Viewer sessions

[](#viewer-sessions)

Create a shareable link for a tenant's audit log:

```
$session = $droplog->viewers->create('tenant_123', ttl: 3600);

// $session['url']        — https://view.droplog.dev/view/tok_...
// $session['expires_at'] — ISO 8601 expiry
```

```
$sessions = $droplog->viewers->list();

$deleted = $droplog->viewers->delete('ses_...');
```

### Alert rules

[](#alert-rules)

```
$rule = $droplog->alertRules->create(['action_pattern' => 'user.*']);

$rules = $droplog->alertRules->list();

$deleted = $droplog->alertRules->delete('alr_...');
```

Error handling
--------------

[](#error-handling)

```
use Droplog\DroplogException;

try {
    $droplog->track([...]);
} catch (DroplogException $e) {
    echo $e->getMessage(); // human-readable message from the API
    echo $e->status;       // HTTP status code (401, 429, etc.)
}
```

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae76abdf99f3056c23eb9f94ca1b2f936f98da190a0ce3aab5ee9a7e8b787d1a?d=identicon)[browskiwave](/maintainers/browskiwave)

---

Top Contributors

[![mariocoulombe](https://avatars.githubusercontent.com/u/30185204?v=4)](https://github.com/mariocoulombe "mariocoulombe (3 commits)")

---

Tags

loggingAuditsaascomplianceaudit-logdroplog

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/droplog-droplog/health.svg)

```
[![Health](https://phpackages.com/badges/droplog-droplog/health.svg)](https://phpackages.com/packages/droplog-droplog)
```

###  Alternatives

[bedezign/yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.

202688.7k4](/packages/bedezign-yii2-audit)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17614.3k](/packages/muhammadsadeeq-laravel-activitylog-ui)[tatter/audits

Lightweight object logging for CodeIgniter 4

1325.3k3](/packages/tatter-audits)[cornernote/yii-audit-module

Track and store usage information including page requests, database field changes and system errors.

226.7k](/packages/cornernote-yii-audit-module)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
