PHPackages                             vasyaxy/trello-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. vasyaxy/trello-php

ActiveLibrary

vasyaxy/trello-php
==================

PHP wrapper for Trello API

v0.5(3y ago)015MITPHPPHP ^8.0

Since Dec 1Pushed 3y agoCompare

[ Source](https://github.com/VasyaXY/trello-php)[ Packagist](https://packagist.org/packages/vasyaxy/trello-php)[ Docs](https://github.com/vasyaxy/trello-php)[ GitHub Sponsors](https://github.com/vasyaxy)[ RSS](/packages/vasyaxy-trello-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

Trello PHP
==========

[](#trello-php)

[![Latest Version](https://camo.githubusercontent.com/8255fbc090d7f61ea5cdf0955fcfc3474760973b15bb32f08655d05f2fc37b5c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f766173796178792f7472656c6c6f2d7068702e7376673f7374796c653d666c61742d737175617265)](https://github.com/vasyaxy/trello-php/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/eb5ed2979f28f3a452ecc5c53a6dabca56374092d5306c26bb6fd303bc3c672a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766173796178792f7472656c6c6f2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vasyaxy/trello-php)

A PHP client for consuming the Trello API.

Install
-------

[](#install)

Via Composer

```
$ composer require vasyaxy/trello-php
```

Usage
-----

[](#usage)

This guide will help you navigate [configuring the client](#configure-the-client), [authenticating your users and retrieving an access token](#authenticate-your-users-and-store-access-token), and [accessing the api on their behalf](#access-the-api-with-access-token).

Full client documentation is available in the [API Guide](API-GUIDE.md).

*Make sure you have secured your Trello API keys before going further. There is [a handy guide](https://trello.com/docs/gettingstarted/index.html) for that.*

This project includes a [basic example](https://github.com/vasyaxy/trello-php/tree/master/example/index.php). You can run this example to test your application details. Open the example file and include your `key` and `secret`, run `php -S localhost:8000 -t example`, visit `http://localhost:8000` in your favorite browser.

### Configure the client

[](#configure-the-client)

The Trello client needs a few configuration settings to operate successfully.

SettingDescription`key`Required, the application key associated with your application.`token`Required when using the package to make authenticated API requests on behalf of a user.`domain`Optional, default is `https://trello.com`.`version`Optional, default is `1`.`secret`Required when using package to help get access tokens, the application secret associated with your application.`name`Optional. This will appear on the user facing approval screen when using package to help get access tokens.`callbackUrl`Required when using package to help get access tokens.`expiration`Required when using package to help get access tokens.`scope`Required when using package to help get access tokens.`proxy`Optional setting to declare a host to use for proxy; [Read more on the Guzzle Docs](http://docs.guzzlephp.org/en/latest/request-options.html#proxy).#### Set configuration when creating client

[](#set-configuration-when-creating-client)

```
$client = new vasyaxy\Services\Trello\Client(array(
    'callbackUrl' => 'http://your.domain/oauth-callback-url',
    'domain' => 'https://trello.com',
    'expiration' => '3days',
    'key' => 'my-application-key',
    'name' => 'My sweet trello enabled app',
    'scope' => 'read,write',
    'secret' => 'my-application-secret',
    'token'  => 'abcdefghijklmnopqrstuvwxyz',
    'version' => '1',
    'proxy' => 'tcp://localhost:8125',
));
```

#### Set multiple configuration after creating client

[](#set-multiple-configuration-after-creating-client)

```
$client = new vasyaxy\Services\Trello\Client(array(
    'key' => 'my-application-key',
    'name' => 'My sweet trello enabled app',
));

$config = array(
    'callbackUrl' => 'http://your.domain/oauth-callback-url',
    'expiration' => '3days',
    'scope' => 'read,write',
);

$client->addConfig($config);
```

#### Set single configuration after creating client

[](#set-single-configuration-after-creating-client)

```
$client = new vasyaxy\Services\Trello\Client(array(
    'key' => 'my-application-key',
    'name' => 'My sweet trello enabled app',
));

$client->addConfig('token', 'abcdefghijklmnopqrstuvwxyz');
```

### Authenticate your users and store access token

[](#authenticate-your-users-and-store-access-token)

The Trello client is capable of assisting you in walking your users through the OAuth authorization process and providing your application with access token credentials.

This package utilizes [The League's OAuth1 Trello Client](https://github.com/thephpleague/oauth1-client) to provide this assistance.

#### Create a basic client

[](#create-a-basic-client)

```
$client = new vasyaxy\Services\Trello\Client(array(
    'key' => 'my-application-key',
    'secret' => 'my-application-secret',
));
```

#### Add your application's required OAuth settings

[](#add-your-applications-required-oauth-settings)

```
$config = array(
    'name' => 'My sweet trello enabled app',
    'callbackUrl' => 'http://your.domain/oauth-callback-url',
    'expiration' => '3days',
    'scope' => 'read,write',
);

$client->addConfig($config);
```

#### Get authorization url, then redirect your user

[](#get-authorization-url-then-redirect-your-user)

```
$authorizationUrl = $client->getAuthorizationUrl();

header('Location: ' . $authorizationUrl);
```

#### Exchange authorization token and verifier for access token

[](#exchange-authorization-token-and-verifier-for-access-token)

After the user approves or denies access to your application, they will be redirected to the callback url you provided. If the user approves access, the url will include `oauth_token` and `oauth_verifier` in query string parameters.

```
$token = $_GET['oauth_token'];
$verifier = $_GET['oauth_verifier'];

$credentials = $client->getAccessToken($token, $verifier);
$accessToken = $credentials->getIdentifier();
```

If successful, `$credentials` with be an instance of [TokenCredentials](https://github.com/thephpleague/oauth1-client/blob/master/src/Client/Credentials/TokenCredentials.php). You can store the identifier within and use to authenticate requests on behalf of that user.

#### Use access token to make requests

[](#use-access-token-to-make-requests)

```
$client->addConfig('token', $accessToken);

$user = $client->getCurrentUser();
```

### Access the API with access token

[](#access-the-api-with-access-token)

Get inventory of all entities that belong to your user

```
$client = new vasyaxy\Services\Trello\Client(array(
    'key' => 'my-application-key',
    'token' => 'your-users-access-token',
));

$boards = $client->getCurrentUserBoards();
$cards = $client->getCurrentUserCards();
$organizations = $client->getCurrentUserOrganizations();
```

Most of the methods available in the [API Guide](API-GUIDE.md) require entity ids to conduct business.

### Handling exceptions

[](#handling-exceptions)

When handling exceptions that result during requests to Trello using the client, a `vasyaxy\Services\Trello\Exceptions\Exception` will be thrown. This exception will include information from the underlying Http request/response issues, including the response body from Trello.

```
try {
    $board = $client->getBoard($boardId);
} catch (vasyaxy\Services\Trello\Exceptions\Exception $e) {
    $code = $e->getCode(); // Http status code from response
    $reason = $e->getMessage(); // Http status reason phrase
    $error = $e->getPrevious(); // GuzzleHttp\Exception\RequestException from http client
    $body = $e->getResponseBody(); // stdClass response body from http client
}
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details. You can see the current [PROGRESS](PROGRESS.md).

Credits
-------

[](#credits)

- [Steven Maguire](https://github.com/vasyaxy)
- [All Contributors](https://github.com/vasyaxy/trello-php/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.8% 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 ~5 days

Total

5

Last Release

1240d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e30e7c21a3bb88b7fcbace41fff4f94457f1adfc990e102cbab0aed264691ccf?d=identicon)[VasyaXY](/maintainers/VasyaXY)

---

Top Contributors

[![stevenmaguire](https://avatars.githubusercontent.com/u/1851973?v=4)](https://github.com/stevenmaguire "stevenmaguire (71 commits)")[![drdaemos](https://avatars.githubusercontent.com/u/1313693?v=4)](https://github.com/drdaemos "drdaemos (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![slav123](https://avatars.githubusercontent.com/u/185637?v=4)](https://github.com/slav123 "slav123 (1 commits)")

---

Tags

phpclientwrappertrellotrello gold

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/vasyaxy-trello-php/health.svg)

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

###  Alternatives

[stevenmaguire/trello-php

PHP wrapper for Trello API

88313.4k2](/packages/stevenmaguire-trello-php)[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)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[automattic/wistia-php

PHP wrapper for Wistia API

1431.9k](/packages/automattic-wistia-php)[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

883.9k3](/packages/digitalstars-simplevk)

PHPackages © 2026

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