PHPackages                             bentonow/bento-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bentonow/bento-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bentonow/bento-php-sdk
======================

🍱 Bento PHP SDK and tracking library

2.1.0(1y ago)7110.5k↓13.9%6MITPHPPHP ^7.1 || ^8.0

Since Feb 15Pushed 1y ago3 watchersCompare

[ Source](https://github.com/bentonow/bento-php-sdk)[ Packagist](https://packagist.org/packages/bentonow/bento-php-sdk)[ Docs](https://github.com/bentonow/bento-php-sdk)[ RSS](/packages/bentonow-bento-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (8)Used By (0)

Bento PHP SDK
=============

[](#bento-php-sdk)

[![](https://camo.githubusercontent.com/ccd52ecdfaa83795016c4a0a4e4a63a9c2d1d786d3e6f379497421d5ce8be325/68747470733a2f2f6170702e62656e746f6e6f772e636f6d2f6272616e642f6c6f676f616e696d2e676966)](https://camo.githubusercontent.com/ccd52ecdfaa83795016c4a0a4e4a63a9c2d1d786d3e6f379497421d5ce8be325/68747470733a2f2f6170702e62656e746f6e6f772e636f6d2f6272616e642f6c6f676f616e696d2e676966)

Tip

Need help? Join our [Discord](https://discord.gg/ssXXFRmt5F) or email  for personalized support.

The Bento PHP SDK makes it quick and easy to build an excellent analytics experience in your PHP application. We provide powerful and customizable APIs that can be used out-of-the-box to track your users' behavior, manage subscribers, and send emails. We also expose low-level APIs so that you can build fully custom experiences.

Get started with our [📚 integration guides](https://docs.bentonow.com), or [📘 browse the SDK reference](https://docs.bentonow.com/subscribers).

❤️ Thank you @cavel (in Discord) from [GuitarCreative](https://guitarcreative.com) for your contribution to the Laravel documentation (which lead to the creation of our new [official Laravel SDK](https://github.com/bentonow/bento-laravel-sdk#Installation-Laravel)).

[![Build Status](https://camo.githubusercontent.com/158646168ffda1bbbc2df3300d1e438c86a7342e0c13fe740bde08a9dfc0d719/68747470733a2f2f7472617669732d63692e6f72672f62656e746f6e6f772f62656e746f2d7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bentonow/bento-php-sdk)

Table of contents
=================

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Getting started](#getting-started)
    - [Installation](#installation)
    - [Configuration](#configuration)
- [Modules](#modules)
- [Type Reference](#types-reference)
- [Things to Know](#things-to-know)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **Simple event tracking**: We make it easy for you to track user events and behavior in your application.
- **Subscriber management**: Easily add, update, and remove subscribers from your Bento account.
- **Custom fields**: Track and update custom fields for your subscribers to store additional data.
- **Purchase tracking**: Monitor customer purchases and calculate lifetime value (LTV) for your subscribers.
- **Batch operations**: Perform bulk imports of subscribers and events for efficient data management.
- **Email validation**: Validate email addresses to ensure data quality.

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

[](#requirements)

The Bento PHP SDK requires PHP 7.4+ and Composer.

Bento Account for a valid **SITE\_UUID**, **BENTO\_PUBLISHABLE\_KEY** &amp; **BENTO\_SECRET\_KEY**.

Getting started
---------------

[](#getting-started)

### Installation

[](#installation)

Install the Bento SDK using Composer:

```
composer require bentonow/bento-php-sdk
```

### Configuration

[](#configuration)

Initialize the Bento client:

```
use bentonow\Bento\BentoAnalytics;

$bento = new BentoAnalytics([
  'authentication' => [
    'secretKey' => 'bento-secret-key',
    'publishableKey' => 'bento-publishable-key'
  ],
  'siteUuid' => 'bento-site-uuid'
]);
```

Modules
-------

[](#modules)

### Analytics (Base Module)

[](#analytics-base-module)

Track events and manage subscribers.

#### Tag a Subscriber

[](#tag-a-subscriber)

```
$bento->V1->tagSubscriber([
  'email' => 'user@example.com',
  'tagName' => 'New Customer',
]);
```

#### Add a Subscriber

[](#add-a-subscriber)

```
$bento->V1->addSubscriber([
  'email' => 'user@example.com',
  'fields' => [
    'firstName' => 'John',
    'lastName' => 'Doe',
  ],
]);
```

#### Remove a Subscriber

[](#remove-a-subscriber)

```
$bento->V1->removeSubscriber([
  'email' => 'user@example.com',
]);
```

#### Update Fields

[](#update-fields)

```
$bento->V1->updateFields([
  'email' => 'user@example.com',
  'fields' => [
    'firstName' => 'John',
  ],
]);
```

#### Track Purchase

[](#track-purchase)

```
$bento->V1->trackPurchase([
  'email' => 'user@example.com',
  'purchaseDetails' => [
    'unique' => [
      'key' => 1234,
    ],
    'value' => [
      'amount' => 100,
      'currency' => 'USD',
    ],
  ],
]);
```

#### Track Event

[](#track-event)

```
$bento->V1->track([
  'email' => 'user@example.com',
  'type' => '$custom.event',
  'details' => [
    'fromCustomEvent' => true,
  ],
]);
```

### Batch

[](#batch)

#### Import Subscribers

[](#import-subscribers)

```
$bento->V1->Batch->importSubscribers([
  'subscribers' => [
    ['email' => 'user1@example.com', 'age' => 25],
    ['email' => 'user2@example.com', 'name' => 'Jane Doe'],
  ]
]);
```

#### Import Events

[](#import-events)

```
use bentonow\Bento\SDK\Batch\BentoEvents;

$bento->V1->Batch->importEvents([
  'events' => [
    ['email' => 'user@example.com', 'type' => BentoEvents::SUBSCRIBE],
    ['email' => 'user@example.com', 'type' => BentoEvents::UNSUBSCRIBE],
    [
      'email' => 'user@example.com',
      'details' => [
        'customData' => 'Used internally.'
      ],
      'type' => '$custom.myEvent'
    ]
  ]
]);
```

### Commands

[](#commands)

#### Add Tag

[](#add-tag)

```
$bento->V1->Commands->addTag([
  'email' => 'user@example.com',
  'tagName' => 'VIP',
]);
```

#### Remove Tag

[](#remove-tag)

```
$bento->V1->Commands->removeTag([
  'email' => 'user@example.com',
  'tagName' => 'VIP',
]);
```

#### Add Field

[](#add-field)

```
$bento->V1->Commands->addField([
  'email' => 'user@example.com',
  'field' => [
    'key' => 'favoriteColor',
    'value' => 'blue',
  ],
]);
```

#### Remove Field

[](#remove-field)

```
$bento->V1->Commands->removeField([
  'email' => 'user@example.com',
  'fieldName' => 'favoriteColor',
]);
```

#### Subscribe

[](#subscribe)

```
$bento->V1->Commands->subscribe([
  'email' => 'user@example.com',
]);
```

#### Unsubscribe

[](#unsubscribe)

```
$bento->V1->Commands->unsubscribe([
  'email' => 'user@example.com',
]);
```

### Events

[](#events)

#### Create Event

[](#create-event)

```
$bento->V1->Events->createEvent([
  'type' => '$completed_onboarding',
  'email' => 'user@example.com',
]);
```

### Experimental

[](#experimental)

#### Validate Email

[](#validate-email)

```
$bento->V1->Experimental->validateEmail([
  'email' => 'user@example.com',
]);
```

#### Guess Gender

[](#guess-gender)

```
$bento->V1->Experimental->guessGender([
  'name' => 'Alex',
]);
```

#### Geolocate

[](#geolocate)

```
$bento->V1->Experimental->geolocate([
  'ip' => '127.0.0.1',
]);
```

#### Check Blacklist

[](#check-blacklist)

```
$bento->V1->Experimental->checkBlacklist([
  'domain' => 'example.com',
]);
```

### Fields

[](#fields)

#### Get Fields

[](#get-fields)

```
$fields = $bento->V1->Fields->getFields();
```

#### Create Field

[](#create-field)

```
$bento->V1->Fields->createField([
  'key' => 'favoriteColor',
]);
```

### Forms

[](#forms)

#### Get Form Responses

[](#get-form-responses)

```
$responses = $bento->V1->Forms->getResponses('form-id-123');
```

### Subscribers

[](#subscribers)

#### Get Subscriber

[](#get-subscriber)

```
$subscriber = $bento->V1->Subscribers->getSubscribers([
  'email' => 'user@example.com',
]);
```

#### Create Subscriber

[](#create-subscriber)

```
$bento->V1->Subscribers->createSubscriber([
  'email' => 'newuser@example.com',
]);
```

### Tags

[](#tags)

#### Get Tags

[](#get-tags)

```
$tags = $bento->V1->Tags->getTags();
```

#### Create Tag

[](#create-tag)

```
$bento->V1->Tags->createTag([
  'name' => 'Premium',
]);
```

Types Reference
---------------

[](#types-reference)

For a detailed reference of the types used in the Bento PHP SDK, please refer to the [Types Reference](https://docs.bentonow.com) section in the full documentation.

Things to Know
--------------

[](#things-to-know)

1. All events must be identified with an email address.
2. Most events are indexed within seconds in your Bento account.
3. Batch operations are available for importing subscribers and events efficiently.
4. The SDK provides seamless integration with Laravel applications.
5. Email validation and experimental features are available for advanced use cases.

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [contributing guidelines](CODE_OF_CONDUCT.md) for details on how to submit pull requests, report issues, and suggest improvements.

License
-------

[](#license)

The Bento SDK for PHP is available as open source under the terms of the [MIT License](LICENSE.md).

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance42

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~239 days

Recently: every ~273 days

Total

7

Last Release

483d ago

Major Versions

v0.1.x-dev → v1.0.02021-02-15

v1.0.0 → v2.0.0.x-dev2022-01-26

PHP version history (2 changes)v0.1.x-devPHP &gt;=7.1

2.1.0PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c3e74a41bec04bc53d5125b1e9f3f9a7978ec548c6f4405cbe7fe870d38f334?d=identicon)[bentonow](/maintainers/bentonow)

---

Top Contributors

[![ziptied](https://avatars.githubusercontent.com/u/379362?v=4)](https://github.com/ziptied "ziptied (27 commits)")[![jessehanley](https://avatars.githubusercontent.com/u/6285267?v=4)](https://github.com/jessehanley "jessehanley (24 commits)")[![shadyendless](https://avatars.githubusercontent.com/u/1154812?v=4)](https://github.com/shadyendless "shadyendless (16 commits)")[![arvesolland](https://avatars.githubusercontent.com/u/2617224?v=4)](https://github.com/arvesolland "arvesolland (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bentonow-bento-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/bentonow-bento-php-sdk/health.svg)](https://phpackages.com/packages/bentonow-bento-php-sdk)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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