PHPackages                             roydejong/userkit - 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. [Database &amp; ORM](/categories/database)
4. /
5. roydejong/userkit

ActiveLibrary[Database &amp; ORM](/categories/database)

roydejong/userkit
=================

Plug-in local user management and analytics

04PHP

Since Mar 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/roydejong/UserKit)[ Packagist](https://packagist.org/packages/roydejong/userkit)[ RSS](/packages/roydejong-userkit/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

UserKit
=======

[](#userkit)

### ⚠️ Heads up

[](#warning-heads-up)

The information in this Readme guide is completly provisional; this is a concept project under development. It's not ready for real use yet, at all. So sorry! 💔

### What is UserKit?

[](#what-is-userkit)

**UserKit is a PHP library for server side analytics that helps you keep track of your users. A powerful drop in user admin panel. It's kind of like Intercom, but completely local.**

Here's some cool stuff you can do with UserKit:

- Customer intelligence: who's using your app, and what are they up to?
- Track events and custom properties for your users.
- Segment users get useful insights.

### Getting started

[](#getting-started)

##### Requirements

[](#requirements)

- PHP 7.1 or newer
- [Composer](https://getcomposer.org/doc/00-intro.md)
- A database (MySQL, SQLite, MSSQL or Postgres)

##### Installation

[](#installation)

You can install UserKit via composer. This will set up the library as a dependency and install the autoloader.

```
composer require roydejong/userkit

```

Userkit currently uses Browscap to collect user agent data, for which you'll need to download up-to-date definitions:

```
vendor/bin/browscap-php browscap:update

```

And that's it. You're ready to start integrating.

### Integrating into your app

[](#integrating-into-your-app)

Next, you'll need to integrate UserKit into your app so it can gather analytics.

##### Starting up

[](#starting-up)

When your application starts, you'll need to provide your database configuration. Here's what that looks like when you're connecting to a MySQL database:

```
UserKit::configure()
    ->setConnectionString('mysql://user:pass@127.0.0.1/dbname?charset=utf8');

```

UserKit will **automatically** install and upgrade itself onto the database you connect it to.

All of its tables will be prefixed with `userkit_`. You can create a separate database if you'd like, or use your existing database if you don't mind a few extra tables.

##### Gathering basic analytics

[](#gathering-basic-analytics)

To capture a request, all you need to do is call on the `capture()` method:

```
UserKit::capture()

```

This will then capture and log the current request and environment data as a single incoming request, which will start to give you some basic activity data.

You can enrich your capture with more data to get more useful insights. For example, if a user is logged in, you can attach some data:

```
UserKit::capture()
    ->user([
        'id' => 1234,
        'name' => 'John Doe',
        'email' => 'john.doe@example.com'
    ])

```

Note: You can call `capture()` multiple times to add more data to the capture. Your data will still be logged once. A capture is saved to the database when your script shuts down, or when you manually call `flush()` on the capture object.

##### Displaying the UserKit admin page

[](#displaying-the-userkit-admin-page)

Here's where it gets good: activate UserKit's Web UI to view analytics and get user insights. It only takes a little bit of code:

```
UserKit::webui()
    ->show()

```

UserKit will build and render the UI for you. Simple as that!

**Note:** It's your responsibility to secure this page to protect your users' privacy. UserKit does not currently provide any authentication functionality.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a6873ef39d8543fca22ac4bbc6ceded1454067f2d82d2b51cdd2642d7f14bed?d=identicon)[roydejong](/maintainers/roydejong)

---

Top Contributors

[![roydejong](https://avatars.githubusercontent.com/u/6772638?v=4)](https://github.com/roydejong "roydejong (29 commits)")

---

Tags

analyticscapturecomposerdatabaseinsightsphp-librarytracking

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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