PHPackages                             boldlinestudios/laravel-revenuecat-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. boldlinestudios/laravel-revenuecat-api

ActiveLibrary[API Development](/categories/api)

boldlinestudios/laravel-revenuecat-api
======================================

A package for Laravel backends to integrate with RevenueCat API v2 via typed methods and structured data objects.

v0.1.2(5mo ago)137MITPHPPHP ^8.2

Since Sep 11Pushed 5mo agoCompare

[ Source](https://github.com/boldlinestudios/laravel-revenuecat-api)[ Packagist](https://packagist.org/packages/boldlinestudios/laravel-revenuecat-api)[ Docs](https://github.com/boldlinestudios/laravel-revenuecat-api)[ RSS](/packages/boldlinestudios-laravel-revenuecat-api/feed)WikiDiscussions main Synced 1mo ago

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

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/93e833cc23f149a3e9489ce5d72bbf3b4b400ac365e7de6f7435df70b28be1a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f6c646c696e6573747564696f732f6c61726176656c2d726576656e75656361742d6170692e737667)](https://packagist.org/packages/boldlinestudios/laravel-revenuecat-api)

Laravel RevenueCat API
======================

[](#laravel-revenuecat-api)

A Laravel package for the RevenueCat API v2, providing typed methods and structured data objects.

> **Note:** This is not an official package of RevenueCat or Laravel.

Quick Example
-------------

[](#quick-example)

```
use BoldLineStudios\RevenueCatApi\Facades\RevenueCat;

$subscription = RevenueCat::getSubscription('sub1ab2c3d4e5');

echo $subscription->getCustomerId();    // "19b8de26-77c1-49f1-aa18-019a391603e2"
echo $subscription->getProductId();     // "prod_1ab2c3d4e5"
echo $subscription->givesAccess();      // true
```

For the full catalog of examples with code, see [ENDPOINTS.md](ENDPOINTS.md). For a complete reference of all API response data structures, see [DATA.md](DATA.md).

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

[](#installation)

You can install the package via composer:

```
composer require boldlinestudios/laravel-revenuecat-api
```

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11+

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=revenuecat-api-config
```

Add the following environment variables to your `.env` file:

```
REVENUECAT_API_KEY=your_api_key_here
REVENUECAT_PROJECT_ID=your_project_id
REVENUECAT_BASE_URL=https://api.revenuecat.com/v2
REVENUECAT_TIMEOUT=30
```

Usage
-----

[](#usage)

You can call methods in two ways. Both return the same results, so use whichever feels clearer.

#### 1) Endpoint-style

[](#1-endpoint-style)

Organized by resource, similar to the REST API.

```
use BoldLineStudios\RevenueCatApi\Facades\RevenueCat;

$customer = RevenueCat::customers()->get('customer_id'); // CustomerData
$customers = RevenueCat::customers()->all(25); // ListPage

foreach ($customers->items() as $c) { /* $c is CustomerData */ }
```

#### 2) Convenience-style

[](#2-convenience-style)

Direct shortcut methods for common operations.

```
use BoldLineStudios\RevenueCatApi\Facades\RevenueCat;

$entitlement = RevenueCat::getEntitlement('entitlement_id'); // EntitlementData
$entitlements = RevenueCat::listEntitlements(10); // ListPage
$newEntitlement = RevenueCat::createEntitlement('premium', 'Premium access to all features'); // EntitlementData
```

Endpoints
---------

[](#endpoints)

Available endpoints with full documentation and examples:

- [Apps](docs/endpoints/apps.md)
- [Customers](docs/endpoints/customers.md)
- [Entitlements](docs/endpoints/entitlements.md)
- [Invoices](docs/endpoints/invoices.md)
- [Offerings](docs/endpoints/offerings.md)
- [Packages](docs/endpoints/packages.md)
- [Paywalls](docs/endpoints/paywalls.md)
- [Products](docs/endpoints/products.md)
- [Projects](docs/endpoints/projects.md)
- [Purchases](docs/endpoints/purchases.md)
- [Subscriptions](docs/endpoints/subscriptions.md)

Response and Data Handling
--------------------------

[](#response-and-data-handling)

- Most methods return **data objects** ([`AppData`](DATA.md#appdata), [`CustomerData`](DATA.md#customerdata), etc.).
- List endpoints return a **`ListPage`** ([`ListPage`](DATA.md#listpage)) wrapper for pagination.

See the full data object catalog [DATA.md](DATA.md).

### Data Objects

[](#data-objects)

Data objects expose typed getters and a `toArray()` method:

```
$product = RevenueCat::getProduct('prod_123');

echo $product->getId();
echo $product->getType();

return $product->toArray();
```

See [`ProductData`](DATA.md#productdata) for all available methods.

### ListPage &amp; Pagination

[](#listpage--pagination)

See [`ListPage`](DATA.md#listpage) documentation in [DATA.md](DATA.md).

List methods return a `ListPage` that handles pagination automatically:

```
// Paginate through all customers
$allCustomers = [];
$cursor = null;
$pageNumber = 1;

do {
    // Get current page (20 customers per page)
    $page = RevenueCat::listCustomers(20, $cursor);

    echo "Page {$pageNumber}: " . count($page->items()) . " customers\n";

    // Process customers on this page
    foreach ($page->items() as $customer) {
        echo $customer->getId();
        echo $customer->getLastSeenPlatform();
        $allCustomers[] = $customer;  // Collect all customers
    }

    // See [CustomerData](DATA.md#customerdata) for all available methods

    // Get cursor for next page
    $cursor = $page->nextCursor();
    $pageNumber++;

} while ($cursor); // Continue until no more pages

echo "Total customers found: " . count($allCustomers);
```

### Advanced Pagination

[](#advanced-pagination)

```
// Custom page size and starting point
$page = RevenueCat::listCustomers(100, 'cursor_123');
```

Error Handling
--------------

[](#error-handling)

Non-2xx responses throw typed exceptions matching RevenueCat’s error model:

- `BadRequestException` (400)
- `AuthenticationException` (401)
- `AuthorizationException` (403)
- `NotFoundException` (404)
- `ConflictException` (409)
- `ValidationException` (422)
- `RateLimitException` (429)
- `ServerErrorException` (5xx)
- `ApiResponseException` (fallback for other errors)

Testing
-------

[](#testing)

```
composer test
```

Linting
-------

[](#linting)

```
composer lint
```

Static Analysis
---------------

[](#static-analysis)

```
composer stan
```

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

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

Released under the [MIT license](LICENSE.md).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance73

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99% 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 ~46 days

Total

3

Last Release

152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96b44b87bf54856c8ee843934686c92beb17c285780407fd61f9294a9ae411dd?d=identicon)[ken@boldlinestudios.com](/maintainers/ken@boldlinestudios.com)

---

Top Contributors

[![javascriptisscary](https://avatars.githubusercontent.com/u/13318285?v=4)](https://github.com/javascriptisscary "javascriptisscary (96 commits)")[![cursoragent](https://avatars.githubusercontent.com/u/199161495?v=4)](https://github.com/cursoragent "cursoragent (1 commits)")

---

Tags

apicomposer-packagedtoslaravelrevenuecatlaravelsdkiaprevenuecatBoldLineStudioslaravel-revenuecats-api

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/boldlinestudios-laravel-revenuecat-api/health.svg)

```
[![Health](https://phpackages.com/badges/boldlinestudios-laravel-revenuecat-api/health.svg)](https://phpackages.com/packages/boldlinestudios-laravel-revenuecat-api)
```

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5010.8k](/packages/claude-php-claude-php-sdk-laravel)[smileymrking/laravel-gateway-worker

GatewayWorker SDK for Laravel

161.8k](/packages/smileymrking-laravel-gateway-worker)

PHPackages © 2026

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