PHPackages                             dugan/sprintly-php - 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. dugan/sprintly-php

ActiveLibrary[API Development](/categories/api)

dugan/sprintly-php
==================

Sprintly API wrapper for PHP 5.4+

v0.0.4(11y ago)324MITPHPPHP &gt;=5.4.0

Since Nov 4Pushed 11y ago4 watchersCompare

[ Source](https://github.com/mikedugan/sprintly-php)[ Packagist](https://packagist.org/packages/dugan/sprintly-php)[ RSS](/packages/dugan-sprintly-php/feed)WikiDiscussions master Synced 1mo ago

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

Sprintly-PHP
============

[](#sprintly-php)

[![Build Status](https://camo.githubusercontent.com/f4684cdaba006ab1c3956f48ba637aa3c079252bbb2e790838c124af0c642dc4/68747470733a2f2f7472617669732d63692e6f72672f6d696b65647567616e2f737072696e746c792d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mikedugan/sprintly-php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/21ad870f83fcd30b987ac473e0086f8029727fa9e7f3ac44fb4bdd024e8975b6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696b65647567616e2f737072696e746c792d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mikedugan/sprintly-php/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f21619e1765d273ce170642ad11ecc023566fae7ec76abd34a86804512acf80d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696b65647567616e2f737072696e746c792d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mikedugan/sprintly-php/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/7bf8c3721daeb4365c964853c0d43dfae296605dc3a66ba1469ff13493b06597/68747470733a2f2f706f7365722e707567782e6f72672f647567616e2f737072696e746c792d7068702f762f737461626c652e737667)](https://packagist.org/packages/dugan/sprintly-php) [![Total Downloads](https://camo.githubusercontent.com/25123329e46f4df65cff9c78f0ecb71b152a6ae07da688111567041739e202cf/68747470733a2f2f706f7365722e707567782e6f72672f647567616e2f737072696e746c792d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/dugan/sprintly-php) [![Latest Unstable Version](https://camo.githubusercontent.com/9c364f700897de5f5a2b1de9cff78b0f49f21f63890efa384854cc2adbdf7bc2/68747470733a2f2f706f7365722e707567782e6f72672f647567616e2f737072696e746c792d7068702f762f756e737461626c652e737667)](https://packagist.org/packages/dugan/sprintly-php) [![License](https://camo.githubusercontent.com/35456a680fc72c021f323574ce2afd2cbc97390417b4eb224d00705815dfe390/68747470733a2f2f706f7365722e707567782e6f72672f647567616e2f737072696e746c792d7068702f6c6963656e73652e737667)](https://packagist.org/packages/dugan/sprintly-php)

This is a library that wraps the Sprint.ly API for PHP 5.4+.

API Status: (:heavy\_check\_mark: Complete, :interrobang: In Progress, :x: Todo)

"CRUD" should be interpreted as:

*Create resource, delete resource, retrieve all of resource, retrieve 1+ resource, update resource*

✔️ Product CRUD

✔️ Product People CRUD

✔️ Product Item CRUD

✔️ Perform lightweight queries of a product's items

✔️ Retrieve children of an item

Quickstart
----------

[](#quickstart)

This package requires [Composer](http://getcomposer.org)

```
composer require "dugan/sprintly-php": "dev-master"
composer update

```

```
$service = new \Dugan\Sprintly\SprintlyService('myemail@example.net', 'mySprintlyAuthKey');
$products = $service->getProductsRepository()->all();
foreach($products as $product) {
    echo $product->getName()."\n";
}

```

How it Works
------------

[](#how-it-works)

Under the hood, we use the Guzzle library to consume the Sprintly [API](https://sprintly.uservoice.com/knowledgebase/topics/15784-api)

Top level entities can be accessed using the wrapper methods in `Dugan\Sprintly\SprintlyService`, or you can use the service to retrieve the individual repositories and work with them.

### Authenticating

[](#authenticating)

Sprintly's API uses HTTP auth with an email address and Auth token which you can retrieve from their website. All API methods require authentication, and several require you to have administrator status on a given product.

How to instantiate the API with your credentials:

`$service = \Dugan\Sprintly\SprintlyService::instance($myEmail, $myAuthkey);`

All examples after this will assume `$service` has already been instantiated with your credentials.

Since the SprintlyService implements the Singleton pattern, we can avoid having to repeatedly instantiate it when it is needed in different places. To retrieve an existing instance, simply call:

`\Dugan\Sprintly\SprintlyService::instance()`

### Common Functionality

[](#common-functionality)

Instead of repeating the following code snippets several times, I will let it suffice to say that most repositories implement the two following methods, used in 3 different ways. We'll demonstrate with the PeopleRepository, but the same methods will exist on other repositories.

To retrieve all of a resource (the index):

`$service->getPeopleRepository()->all()`

To retrieve a single resource (the GET):

`$service->getPeopleRepository()->get($id)`

To retrieve a collection of resources, but not all of them:

`$service->getPeopleRepository()->get([$firstId, $secondId])`

Note this will execute multiple HTTP requests, so when working with more than a couple resources, it is often more efficient to retrieve all resources and filter them locally.

There are also wrapper methods for retrieving an entity's repository through the service:

`$service->products()->get($id)`

`$service->items()->all()`

etc

### Products

[](#products)

The Product is top-level entity in Sprintly. It has items, people, attachments, tags, etc related to it, which can all be accessed through the API.

##### Retrieve all products:

[](#retrieve-all-products)

*Using SprintlyService*

`$service->getAllProducts()`

Returns an array of `\Dugan\Sprintly\Entities\Product`

##### Retrieve a single product:

[](#retrieve-a-single-product)

*Using SprintlyService*

`$service->getProduct($id)`

Returns an instance of `\Dugan\Sprintly\Entities\Product`

Retrieve a collection of products (but not all of them!):

*Using SprintlyService*

`$service->getProduct([$firstId, $secondId])`

*Using ProductsRepository*

`$service->getProductsRepository()->get([$firstId, $secondId])`

Returns an array of `\Dugan\Sprintly\Entities\Product`

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD The returned product will have several properties on it which are available for your use:

```
$product->getName();
$product->getCreatedBy();
$product->getId();
$product->getCreatedAt();
$product->getWebhook();

```

The webhook is especially useful if you want to integrate Sprintly with GitHub or Bitbucket for closing items via commit messages.

### The Product ID

[](#the-product-id)

Most of the entities represented by the Sprintly API are only accessible in the context of a product.

Unless otherwise noted, from here on out you should assume all code examples are preceded by:

`$service->setProductId($productId)`

This will allow the service to automatically inject the product ID into the appropriate repositories before returning them back to you.

Note that the SprintlyService is a singleton, and will therefore retain the last product ID set on it until you set another product ID on it.

### Users

[](#users)

In the Sprintly verbiage, users are called people and person. The API wrapper reflects this. You can only retrieve people in the context of a product.

To invite a user to a product:

```
$user = new \Dugan\Sprintly\Entities\Person();
$user->setFirstName('Mike');
$user->setLastName('Dugan');
$user->setEmail('foo@bar.com');
$invitedUser = $service->people()->invite($user);

```

### Items

[](#items)

Items are the stories, tasks, defects, etc that belong to a product. Again, these can only be retrieved in the context of a product.

To create a new item:

```
$item = new \Dugan\Sprintly\Entities\Item();
$item->setTitle('Something broke');
$item->setAssignedTo($myUserId);
$item->setTags('major,bug');
$service->items()->create($item);

```

To retrieve an item's children:

```
$item = $service->items()->get($itemId);
$children = $service->items()->children($item);

```

#### Annotations

[](#annotations)

#### Attachments

[](#attachments)

#### Comments

[](#comments)

### Tags

[](#tags)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Every ~12 days

Total

4

Last Release

4177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/80ee0fb3dc9c2db4eb76ce13e4e5d179b092137cb8b870f8c43b7ec51f189d89?d=identicon)[mikedugan](/maintainers/mikedugan)

---

Top Contributors

[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

apisprintly

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dugan-sprintly-php/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

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