heise/shariff
PHP backend for Shariff that fetches social share counts without client-side requests to social networks. Supports Buffer, Facebook, Pinterest, Reddit, Xing, VK and more, with domain whitelisting and configurable caching (filesystem or Laminas adapters).
Adopt If:
Look Elsewhere If:
"Shariff lets us track how users share our content on social media—without the privacy risks or performance drag of third-party scripts. It’s self-hosted, GDPR-compliant, and integrates seamlessly with our Laravel stack. For example, Heise.de (a German media giant) uses it to avoid Facebook’s tracking pitfalls while still measuring engagement. This aligns with our [Privacy by Design](insert link) initiative and reduces dependency on external vendors. ROI: Lower legal risk, faster page loads, and actionable data for content teams."
Ask:
*"Shariff is a batteries-included PHP package that handles the heavy lifting of privacy-compliant social share counting. Here’s how we’d leverage it:
Integration:
/api/shariff) or drop it into an existing project.Backend class) to fetch counts programmatically:
$shariff = new \Heise\Shariff\Backend($config);
$counts = $shariff->get('https://example.com/article');
Customization:
LaminasCache for Redis (recommended for scale) or APCu for low-latency environments.['Facebook', 'Pinterest']) to minimize API calls.app_id/secret config to fetch real-time counts via Graph API (requires a Facebook Developer account).Frontend:
<div class="share-this"></div> with Shariff’s privacy-friendly buttons.Scaling:
client options (e.g., timeout, retries).Trade-offs:
Next Steps:
Ask:
CacheInterface for our specific caching layer?"How can I help you explore Laravel packages today?