PHPackages                             brightflair/spektrix-api - 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. [API Development](/categories/api)
4. /
5. brightflair/spektrix-api

ActiveLibrary[API Development](/categories/api)

brightflair/spektrix-api
========================

Self-documenting, type-safe Spektrix web API.

v0.1.0(2y ago)0336↓50%1[1 PRs](https://github.com/BrightFlair/spektrix-api/pulls)PHPCI failing

Since Jan 31Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/BrightFlair/spektrix-api)[ Packagist](https://packagist.org/packages/brightflair/spektrix-api)[ GitHub Sponsors](https://github.com/sponsors/g105b)[ RSS](/packages/brightflair-spektrix-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

Self-documenting, type-safe Spektrix web API.
=============================================

[](#self-documenting-type-safe-spektrix-web-api)

This is an unofficial library for accessing [Spektrix's v3 API](https://integrate.spektrix.com/docs/API3), built to abstract complex authentication in a self-documenting, type-safe PHP API.

Getting an access key
---------------------

[](#getting-an-access-key)

Official docs here:

1. Associate a username, email address and mobile telephone number to a new API user.
2. The **username** is required, along with a provided **client name**, to access the API.
3. Email address will receive a link to click with a one-off token.
4. On the page linked via email, enter a code sent via SMS.
5. You will receive your **secret API key** - this is used when construct the `Client` object.

Authentication
--------------

[](#authentication)

API authentication is abstracted by this library, because it involves a multiple-step time-sensitive SHA-1 hashing exercise. To authenticate this library, pass your **username** and **client name** into the constructor of the `Client` object.

```
$username = "greg\brightflair";
$clientName = "api-test";
$secretKey = "S2VlcCB5b3VyIGtuaWNrZXJzIG9uISBUaGlzIGlzIGEgdGVzdCBBUEkga2V5LCBkb24ndCB3b3JyeSE=";
$client = new BrightFlair\SpektrixAPI\Client($username, $clientName, $secretKey);
```

Endpoints of the API
--------------------

[](#endpoints-of-the-api)

Endpoints are mapped to type-safe functions in the library. Use your IDE for self-documentation, with the following naming convention:

- Functions begin with "create" / "get" / "update".
- Functions then include the entity name, such as "customer" / "tag".
- Matching mechanisms are provided as named parameters, such as "id" / "name".

Example call to get a customer, get a tag by its name, and add the tag to the customer's record:

```
$customer = $client->getCustomerByEmail("greg.bowler@brightflair.com");
$tag = $client->getTagByName("Example tag");
$client->addTagToCustomer($customer, $tag);
```

Missing functionality
---------------------

[](#missing-functionality)

I have built this library for my own use to integrate with [Nimbus Disability](https://www.nimbusdisability.com). I don't plan on building any more functionality than is required for the type of integration I'm using, [unless someone persuades me](https://github.com/sponsors/g105b) to develop it further.

The following features are implemented, and tested with examples:

- Create customer
- Get customer (id or email)
- Get tag by ID
- Get all tags
- Get tags for customer
- Add tag to customer
- Remove tag from customer

More functionality will only be added as and when it is required by integrations, but others are free to create pull requests.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance47

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.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

Unknown

Total

1

Last Release

837d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e42344b91ce4b91ab57875969f67a0a6a48de570a08bc65d673b06b72fd3a3f?d=identicon)[g105b](/maintainers/g105b)

---

Top Contributors

[![g105b](https://avatars.githubusercontent.com/u/358014?v=4)](https://github.com/g105b "g105b (2 commits)")[![khaoulalabyad](https://avatars.githubusercontent.com/u/130985221?v=4)](https://github.com/khaoulalabyad "khaoulalabyad (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/brightflair-spektrix-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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