PHPackages                             xcoobee/xcoobee-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. xcoobee/xcoobee-sdk

ActiveLibrary

xcoobee/xcoobee-sdk
===================

XcooBee Privacy and GDPR SDK for PHP

14.1(5y ago)232Apache-2.0PHPPHP &gt;=5.5CI failing

Since Jan 29Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/XcooBee/xcoobee-php-sdk)[ Packagist](https://packagist.org/packages/xcoobee/xcoobee-sdk)[ RSS](/packages/xcoobee-xcoobee-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (8)Versions (29)Used By (0)

XcooBee PHP SDK
===============

[](#xcoobee-php-sdk)

The XcooBee SDK is a facility to abstract lower level calls and implement standard behaviors. The XcooBee team is providing this to improve the speed of implementation and show the best practices while interacting with XcooBee.

Generally, all communication with XcooBee is encrypted over the wire since none of the XcooBee systems will accept plain traffic. All data sent to XcooBee from you and vice versa is going to use encryption. In addition, non-bee event communication to you is also signed using your PGP key.

If you need to generate new PGP keys you can login to your XcooBee account and go to the `Settings` page to do so.

XcooBee systems operate globally but with regional connections. The SDK will be connecting you to your regional endpoint automatically.

There is detailed and extensive [API documentation](API.md).

Installation
============

[](#installation)

`composer require xcoobee/xcoobee-sdk`

Usage
=====

[](#usage)

Before using the SDK, it needs to be configured. Once created, the configuration can be set on the SDK instance. In this case, each function call will fallback to using this configuration. Alternatively, you may pass a reference to a configuration instance to each function call. This passed configuration will take precedence over any configuration set on the SDK instance.

```
use XcooBee\XcooBee;

$sdk = new XcooBee();
```

The config object
-----------------

[](#the-config-object)

The config object carries all basic configuration information for your specific setup and use. It can be transparent handled by the SDK or specifically passed into every function. The basic information in the configuration is:

- your api-key from XcooBee
- your api-secret from XcooBee
- your pgp-secret/passphrase either from you or XcooBee
- your default campaign Id from XcooBee

The SDK will attempt to determine the configuration object based on the following schema:

1.) Use the configuration object passed into the function.

2.) Use the information as set by the setConfig call.

3.) Check the file system for the config file (.xcoobee/config)

```
$config = \XcooBee\Models\ConfigModel::createFromFile();
```

or

```
$config = \XcooBee\Models\ConfigModel::createFromData([
    'apiKey'    => '',
    'apiSecret' => '',
]);
```

```
apiKey      => the api-key as supplied by XcooBee account
apiSecret   => the api-secret (downloaded when api key was created at XcooBee)
pgpSecret   => the pgp-secret key either generated by XcooBee or supplied by you
pgpPassword => the pgp-password supplied by you
campaignId  => the default campaign Id from your campaign on XcooBee
pageSize    => pagination limit (records per page), default based on recordset, max possible is 100

```

### setConfig(config)

[](#setconfigconfig)

The `setConfig` call is the mechanism to create the initial configuration object. You can use it multiple times. Each time you call you will override the existing data. The data once set will persist until library is discarded or `clearConfig` is called.

```
$sdk->setConfig($config);
```

### clearConfig()

[](#clearconfig)

Removes all configuration data in the configuration object.

### config on file system

[](#config-on-file-system)

XcooBee SDK will search the file system for configuration info as last mechanism. You should ensure that the access to the config files is not public and properly secured. Once found the information is cached and no further lookup is made. If you change your configuration you will need to restart the process that is using the SDK to pick up the changes.

We recommend that you also look into how to encrypt the contents of these files with OS specific encryption for use only by the process that uses the XcooBee SDK.

The files will be located inside your `home` directory in the `.xcoobee` subdirectory. Thus the full path to config are:

`/[home]/.xcoobee/config` =&gt; the configuration options

`/[home]/.xcoobee/pgp.secret` =&gt; the pgp secret key in separate file

on Windows it is in the root of your user directory

`/Users/MyUserDir/.xcoobee/config` =&gt; the configuration option

`/Users/MyUserDir/.xcoobee/pgp.secret` =&gt; the pgp secret key in separate file

The initial content of the config file is plain text, with each option on a separate line.

**example file**:

```
apiKey=8sihfsd89f7
apiSecret=8937438hf
campaignId=ifddb4cd9-d6ea-4005-9c7a-aeb104bc30be
pgpPassword=somethingsecret
pageSize=10

```

options:

```
apiKey      => the api-key
apiSecret   => the api-secret
campaignId  => the default campaign id
pgpPassword => the password for your pgp key
pageSize    => pagination limit

```

Example
-------

[](#example)

```
$bees = $sdk->bees->listBees()->result;
```

More examples see in `example` folder.

Tests
=====

[](#tests)

Running Unit Tests
------------------

[](#running-unit-tests)

You can use the following command line to run unit test to validate the project

`phpunit -c ./test/phpunit.xml`

Running Integration Tests
-------------------------

[](#running-integration-tests)

When your initial developer account is created it will be populated with data so that you can test the project against actual data and system. You will have to configure your `test/integration/assets/config/.xcoobee/config` file prior to running the integration tests.

You can use a command line to run the integration tests for this project. You will need to **clone the repo** from GitHub and run the following command line:

`phpunit -c ./test/integration/phpunit.xml`

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance56

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 60.7% 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 ~25 days

Recently: every ~75 days

Total

24

Last Release

2069d ago

Major Versions

0.9.0 → 1.0.02019-02-04

1.4.0 → 14.12020-09-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/69a1e3f23304d6bf22d0e1d359785501ad01fac15b8362b4b67aba50df4d0007?d=identicon)[XcooBee](/maintainers/XcooBee)

---

Top Contributors

[![fullstackdevloper](https://avatars.githubusercontent.com/u/34055828?v=4)](https://github.com/fullstackdevloper "fullstackdevloper (162 commits)")[![Bilal-S](https://avatars.githubusercontent.com/u/668901?v=4)](https://github.com/Bilal-S "Bilal-S (61 commits)")[![vrabeshko](https://avatars.githubusercontent.com/u/36031475?v=4)](https://github.com/vrabeshko "vrabeshko (28 commits)")[![vboychyk](https://avatars.githubusercontent.com/u/14885911?v=4)](https://github.com/vboychyk "vboychyk (12 commits)")[![sunderm](https://avatars.githubusercontent.com/u/33343500?v=4)](https://github.com/sunderm "sunderm (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[google/cloud

Google Cloud Client Library

1.2k16.2M54](/packages/google-cloud)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M78](/packages/google-cloud-core)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)

PHPackages © 2026

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