承接 carloeusebi/laravel-rybbit-tunnel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

carloeusebi/laravel-rybbit-tunnel

最新稳定版本:v0.4.2

Composer 安装命令:

composer require carloeusebi/laravel-rybbit-tunnel

包简介

Provides endpoints to use as reverse-proxy for Rybbit analytics tool

README 文档

README

A Laravel package that acts as a reverse proxy for Rybbit analytics. Routes analytics traffic through your own domain to avoid ad blockers and improve data accuracy.

Requirements

  • PHP 8.2+
  • Laravel 12 or 13

Installation

composer require carloeusebi/laravel-rybbit-tunnel

The service provider is auto-discovered. Publish the config file if you need to customise it:

php artisan vendor:publish --tag=rybbit-tunnel-config

Configuration

Add to your .env:

RYBBIT_TUNNEL_HOST=https://app.rybbit.io   # your Rybbit instance URL
RYBBIT_TUNNEL_URL=/analytics                # local route prefix
RYBBIT_TUNNEL_DEBUG=false                   # enable verbose request logging

Full config (config/rybbit-tunnel.php):

return [
    'host'             => env('RYBBIT_TUNNEL_HOST', 'https://app.rybbit.io'),
    'tunnel-url'       => env('RYBBIT_TUNNEL_URL', '/analytics'),
    'cache-key-prefix' => 'rybbit_',
    'debug'            => env('RYBBIT_TUNNEL_DEBUG', false),
    'middleware'       => ['web'],
];

Middleware

By default the routes use the web middleware group. Override via config:

'middleware' => ['web', 'auth'],

Routes

The package registers the following routes under the configured prefix (default /analytics):

Method Path Description
GET /{script} Proxy analytics scripts (script.js, script-full.js, replay.js, metrics.js) — cached 1 hour
POST /track Proxy pageview/event tracking
POST /identify Proxy user identification
POST /session-replay/record/{siteId} Proxy session replay data — dispatched via queue
GET /site/tracking-config/{siteId} Proxy site tracking config — cached 1 hour

Usage

Point your Rybbit script tag at your tunnel URL instead of the Rybbit host directly:

<script
  src="/analytics/script.js"
  data-site-id="your-site-id"
  async
></script>

Session Replay

Session replay requests are dispatched as queued jobs (ForwardRybbitData) to avoid blocking the response. Make sure your queue worker is running:

php artisan queue:work

Caching

Script files and site tracking configs are cached for 1 hour using Laravel's default cache driver. The cache key prefix defaults to rybbit_ and is configurable.

Debugging

Set RYBBIT_TUNNEL_DEBUG=true to log incoming proxy request details (method, path, URL, headers, client IP) at the debug level. Sensitive headers (Authorization, Cookie, X-CSRF-Token) are redacted automatically.

License

MIT

统计信息

  • 总下载量: 484
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固