PHPackages                             codebard/patreon-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. codebard/patreon-php

ActiveLibrary[API Development](/categories/api)

codebard/patreon-php
====================

Interact with the Patreon API via OAuth.

1.0.1(7y ago)097MITPHPPHP &gt;=5.3.0

Since Oct 9Pushed 4y agoCompare

[ Source](https://github.com/codebard/patreon-php)[ Packagist](https://packagist.org/packages/codebard/patreon-php)[ RSS](/packages/codebard-patreon-php/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (10)DependenciesVersions (36)Used By (0)

patreon-php
===========

[](#patreon-php)

Interact with the Patreon API via OAuth.

Important notice about updating to 1.0.0 from earlier versions
--------------------------------------------------------------

[](#important-notice-about-updating-to-100-from-earlier-versions)

Patreon PHP library version 1.0.0 moves on to Patreon's v2 API, which is not compatible with old v1 calls. It also removes Art4 JSON library. Therefore directly upgrading from older versions to 1.0.0 would break compatibility of your installation. APIv1 will deprecated some time soon after APIv2 come out of beta, so its important to get your integration compatible with API v2. With API v2, you can only get access to the scopes you requested during authorization, and you need to ask for the data you want through includes.

If you were using Art4 library before, you can separately install it and feed the return from API calls to Art4 library after getting it as JSON from this library. This will make your existing code that uses Art4 library compatible. However note that you will need to track Art4 library updates and resulting compatibility issues yourself.

If you have any questions or issues, please visit our developer forum at

NOTE: This library is made to be compatible with the maximum possible variety of different infrastructures, PHP versions and environments in order to cover a majority of potential integrations. If you would like to use more specialized versions of this lib with different amenities and additions/dependencies to better suit your environment, below is a list. If you would like your fork added to this list, please contact us [at the forums](https://www.patreondevelopers.com/).

[soatok's fork](https://github.com/soatok/patreon-php) with PHP 7.x, PHPunit, Psalm, BLAKE2b instead of MD5

Installation
------------

[](#installation)

Currently the repo at packagist is at 0.3.x and API v1 only, whereas the one at Github is at 1.0.0 and API v2 due to compatibility reasons for older installations which were done via composer. Until we sync the packagist version with the Github version, please use this repo by cloning it from Github, or downloading and uploading it to your environment via file transfer.

Usage
-----

[](#usage)

### Step 1. Get your client\_id and client\_secret

[](#step-1-get-your-client_id-and-client_secret)

Visit the [Patreon platform documentation page](https://www.patreon.com/platform/documentation)while logged in as a Patreon creator to register your client.

This will provide you with a `client_id` and a `client_secret`.

### Step 2. Use this plugin in your code

[](#step-2-use-this-plugin-in-your-code)

Let's say you wanted to make a "Log In with Patreon" button.

You've read through [the directions](https://www.patreon.com/platform/documentation/oauth), and are trying to implement "Step 2: Handling the OAuth Redirect" with your server.

The user will be arriving at one of your pages *after* you have sent them to \[the authorize page\] ([www.patreon.com/oauth2/authorize](http://www.patreon.com/oauth2/authorize)) for step 1, so in their query parameters landing on this page, they will have a parameter `'code'`.

*(If you are doing something other than the "Log In with Patreon" flow, please see [the examples folder](examples) for more examples)*

*(Especially the unified flow is a great way to have users unlock locked features or content at your site or app - it allows users to register, login, pledge and return to your app in one smooth unified flow. Check it out in [the examples folder](examples) )*

```
