PHPackages                             alialican/hubspot-rate-limiter - 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. alialican/hubspot-rate-limiter

ActiveLibrary

alialican/hubspot-rate-limiter
==============================

This package wraps default hubspot/api-client package with a rate limiter, so that you dont breach API limits

v1.0.1-beta(2y ago)21MITPHPPHP &gt;=8.0

Since Jul 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AliAlican/hubspot-rate-limiter)[ Packagist](https://packagist.org/packages/alialican/hubspot-rate-limiter)[ RSS](/packages/alialican-hubspot-rate-limiter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

HubSpot Rate Limiter
====================

[](#hubspot-rate-limiter)

This package provides a rate limiting wrapper for the HubSpot API client, allowing you to set per-second and daily rate limits for your HubSpot API calls. It leverages the Redis cache store for efficient rate limiting. If Redis is not available, it falls back to a generic cache implementation.

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

[](#installation)

Install the package using Composer:

```
composer require alialican/hubspot-rate-limiter
```

Usage:

1.Import the package in your code:

`use HubSpotRateLimiter\HubSpotClientWrapper;`

2.Create an instance of the HubspotClientWrapper class and pass in the required dependencies:

```
use Illuminate\Support\Facades\Cache;
use HubSpot\Discovery\Discovery;

$hubspotClient = new Discovery();

$secondLimit = 100; // Replace with your desired per-second limit
$dailyLimit = 250000; // Replace with your desired daily limit

$hubspot = new HubspotClientWrapper($hubspotClient, $secondLimit, $dailyLimit);

```

Use the $hubspot instance as you would use the original HubSpot API client. The rate limiter will automatically enforce the specified rate limits on each API call.

`$result = $hubspot->crm()->contacts()->getAll();`

Important Points

This package uses Laravel's Cache facade for rate limiting. Make sure you have the proper cache driver set up in your Laravel configuration. When the cache driver is Redis, the rate limiter directly interacts with Redis for efficient rate limiting. Ensure that your Redis configuration is correctly set up. If your Redis setup is unusual or complex, the Redis-based rate limiting may not work as expected. The rate limiting mechanism used in the enforceRateLimitGeneric method is simplistic and may not handle high rates of concurrency as efficiently as the Redis-based solution. The package assumes that the Redis server supports the eval command, as it uses Lua scripts for rate limiting. If your Redis server does not support this command, the rate limiting may fail. Please test the package thoroughly in your specific environment to ensure it meets your requirements and works correctly with your Redis configuration.

License This package is open-source and licensed under the MIT License.

`Feel free to customize and expand on the README to provide more information or clarify any additional details specific to your use case.`

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

1044d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1997fa1e8568df15476e84cdedf312d958c5b2ff586f4ab4e93b483760d6d488?d=identicon)[AliAlican](/maintainers/AliAlican)

---

Top Contributors

[![AliAlican](https://avatars.githubusercontent.com/u/44370554?v=4)](https://github.com/AliAlican "AliAlican (6 commits)")

### Embed Badge

![Health badge](/badges/alialican-hubspot-rate-limiter/health.svg)

```
[![Health](https://phpackages.com/badges/alialican-hubspot-rate-limiter/health.svg)](https://phpackages.com/packages/alialican-hubspot-rate-limiter)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[teamtnt/tntsearch

A fully featured full text search engine written in PHP

3.2k3.0M28](/packages/teamtnt-tntsearch)[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)

PHPackages © 2026

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