PHPackages                             elbunkerbitcoin/heatmap-client - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. elbunkerbitcoin/heatmap-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elbunkerbitcoin/heatmap-client
==============================

Cliente PHP oficial para integrar el heatmap de liquidaciones de El Búnker Bitcoin (CDN). Firma presigned URLs con HMAC para que el browser pueda consumir /api/heatmap/\* sin exponer credenciales.

09PHP

Since May 7Pushed 1mo agoCompare

[ Source](https://github.com/angelcripto/heatmap-client)[ Packagist](https://packagist.org/packages/elbunkerbitcoin/heatmap-client)[ RSS](/packages/elbunkerbitcoin-heatmap-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

elbunkerbitcoin/heatmap-client
==============================

[](#elbunkerbitcoinheatmap-client)

Cliente PHP oficial para integrar el **heatmap de liquidaciones** de [El Búnker Bitcoin](https://elbunkerbitcoin.com) en tu sitio web o backend. Firma presigned URLs con HMAC-SHA256 para que el browser pueda consumir el CDN sin exponer credenciales, y opcionalmente hace llamadas server-to-server desde tu backend.

Requisitos
----------

[](#requisitos)

- PHP `^7.4 | ^8.0`
- Extensiones `json`, `openssl`, `curl` (las dos primeras vienen activadas por defecto; `curl` solo es necesaria si vas a usar los métodos `fetch*` server-to-server)

Instalación
-----------

[](#instalación)

```
composer require elbunkerbitcoin/heatmap-client
```

Configuración
-------------

[](#configuración)

1. Pide a El Búnker tus credenciales (panel admin → Heatmap Licenses). Recibirás:

    - `BUNKER_LICENSE_KEY` — pública, viaja en URLs.
    - `BUNKER_HMAC_SECRET` — privada, **NO sale jamás del backend**.
2. Mete las dos en tu `.env`:

    ```
    BUNKER_LICENSE_KEY=tu_license_key_aqui
    BUNKER_HMAC_SECRET=tu_hmac_secret_aqui
    ```

---

Dos modos de integración
------------------------

[](#dos-modos-de-integración)

ModoUsaCuándo**Embed** (browser)Firma URLs con `signRequest()`, las devuelves al browser, la lib JS las consumeEl browser de tu usuario va a cargar el heatmap (lib `` embed). Requiere license con `allowed_origins`.**Server-to-Server (S2S)**`fetch()` desde tu backend con cURLTu backend procesa los datos: cache, agregaciones, reportes, alertas. Requiere license con `allowed_ips` (la IP de tu server).El server detecta el modo automáticamente por la presencia del header `Origin` (browser sí, cURL no). Una misma license puede tener ambos campos configurados para servir a los dos modos.

---

Modo Embed (browser)
--------------------

[](#modo-embed-browser)

### 1. Endpoint en tu backend (`/heatmap-sign`)

[](#1-endpoint-en-tu-backend-heatmap-sign)

```
